Date: (Sun) Jun 12, 2016

Introduction:

Data: Source: Training: “https://inclass.kaggle.com/c/can-we-predict-voting-outcomes/download/train2016.csv
New: “https://inclass.kaggle.com/c/can-we-predict-voting-outcomes/download/test2016.csv
Time period:

Synopsis:

Based on analysis utilizing <> techniques, :

Summary of key steps & error improvement stats:

Prediction Accuracy Enhancement Options:

  • transform.data chunk:
    • derive features from multiple features
  • manage.missing.data chunk:
    • Not fill missing vars
    • Fill missing numerics with a different algorithm
    • Fill missing chars with data based on clusters

[](.png)

Potential next steps include:

  • Organization:
    • Categorize by chunk
    • Priority criteria:
      1. Ease of change
      2. Impacts report
      3. Cleans innards
      4. Bug report
  • all chunks:
    • at chunk-end rm(!glb_)
  • manage.missing.data chunk:
    • cleaner way to manage re-splitting of training vs. new entity
  • extract.features chunk:
    • Add n-grams for glbFeatsText
      • “RTextTools”, “tau”, “RWeka”, and “textcat” packages
  • fit.models chunk:
    • Classification: Plot AUC Curves for all models & highlight glbMdlSel
    • Prediction accuracy scatter graph:
    • Add tiles (raw vs. PCA)
    • Use shiny for drop-down of “important” features
    • Use plot.ly for interactive plots ?

    • Change .fit suffix of model metrics to .mdl if it’s data independent (e.g. AIC, Adj.R.Squared - is it truly data independent ?, etc.)
    • create a custom model for rpart that has minbucket as a tuning parameter
    • varImp for randomForest crashes in caret version:6.0.41 -> submit bug report

  • Probability handling for multinomials vs. desired binomial outcome
  • ROCR currently supports only evaluation of binary classification tasks (version 1.0.7)
  • extensions toward multiclass classification are scheduled for the next release

  • fit.all.training chunk:
    • myplot_prediction_classification: displays ‘x’ instead of ‘+’ when there are no prediction errors
  • Compare glb_sel_mdl vs. glb_fin_mdl:
    • varImp
    • Prediction differences (shd be minimal ?)
  • Move glb_analytics_diag_plots to mydsutils.R: (+) Easier to debug (-) Too many glb vars used
  • Add print(ggplot.petrinet(glb_analytics_pn) + coord_flip()) at the end of every major chunk
  • Parameterize glb_analytics_pn
  • Move glb_impute_missing_data to mydsutils.R: (-) Too many glb vars used; glb_<>_df reassigned
  • Do non-glm methods handle interaction terms ?
  • f-score computation for classifiers should be summation across outcomes (not just the desired one ?)
  • Add accuracy computation to glb_dmy_mdl in predict.data.new chunk
  • Why does splitting fit.data.training.all chunk into separate chunks add an overhead of ~30 secs ? It’s not rbind b/c other chunks have lower elapsed time. Is it the number of plots ?
  • Incorporate code chunks in print_sessionInfo
  • Test against
    • projects in github.com/bdanalytics
    • lectures in jhu-datascience track

Analysis:

rm(list = ls())
set.seed(12345)
options(stringsAsFactors = FALSE)
source("~/Dropbox/datascience/R/mycaret.R")
source("~/Dropbox/datascience/R/mypetrinet.R")
source("~/Dropbox/datascience/R/myplclust.R")
source("~/Dropbox/datascience/R/myplot.R")
source("~/Dropbox/datascience/R/myscript.R")
source("~/Dropbox/datascience/R/mytm.R")
if (is.null(knitr::opts_current$get(name = 'label'))) # Running in IDE
    debugSource("~/Dropbox/datascience/R/mydsutils.R") else
    source("~/Dropbox/datascience/R/mydsutils.R")    
## Loading required package: caret
## Loading required package: lattice
# Gather all package requirements here
suppressPackageStartupMessages(require(doMC))
glbCores <- 10 # of cores on machine - 2
registerDoMC(glbCores) 

suppressPackageStartupMessages(require(caret))
require(plyr)
## Loading required package: plyr
require(dplyr)
## Loading required package: dplyr
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:plyr':
## 
##     arrange, count, desc, failwith, id, mutate, rename, summarise,
##     summarize
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
require(knitr)
## Loading required package: knitr
require(stringr)
## Loading required package: stringr
#source("dbgcaret.R")
#packageVersion("snow")
#require(sos); findFn("cosine", maxPages=2, sortby="MaxScore")

# Analysis control global variables
# Inputs
#   url/name = "<PathPointer>"; if url specifies a zip file, name = "<filename>"; 
#               or named collection of <PathPointer>s
#   sep = choose from c(NULL, "\t")
glbObsTrnFile <- list(url = "https://inclass.kaggle.com/c/can-we-predict-voting-outcomes/download/train2016.csv"
    # or list(url = c(NULL, <.inp1> = "<path1>", <.inp2> = "<path2>"))
    #, splitSpecs = list(method = "copy" # default when glbObsNewFile is NULL
    #                       select from c("copy", NULL ???, "condition", "sample", )
    #                      ,nRatio = 0.3 # > 0 && < 1 if method == "sample" 
    #                      ,seed = 123 # any integer or glbObsTrnPartitionSeed if method == "sample" 
    #                      ,condition = # or 'is.na(<var>)'; '<var> <condition_operator> <value>'    
    #                      )
    )                   
 
glbObsNewFile <- list(url = "https://inclass.kaggle.com/c/can-we-predict-voting-outcomes/download/test2016.csv") 

glbObsDropCondition <- #NULL # : default
#   enclose in single-quotes b/c condition might include double qoutes
#       use | & ; NOT || &&    
#   '<condition>' 
    # 'grepl("^First Draft Video:", glbObsAll$Headline)'
    # 'is.na(glbObsAll[, glb_rsp_var_raw])'
    # '(is.na(glbObsAll[, glb_rsp_var_raw]) & grepl("Train", glbObsAll[, glbFeatsId]))'
    # 'is.na(strptime(glbObsAll[, "Date"], glbFeatsDateTime[["Date"]]["format"], tz = glbFeatsDateTime[["Date"]]["timezone"]))'
'(is.na(glbObsAll[, "Q109244"]) | (glbObsAll[, "Q109244"] != "No"))'
#nrow(do.call("subset",list(glbObsAll, parse(text=paste0("!(", glbObsDropCondition, ")")))))
    
glb_obs_repartition_train_condition <- NULL # : default
#    "<condition>" 

glb_max_fitobs <- NULL # or any integer
glbObsTrnPartitionSeed <- 123 # or any integer
                         
glb_is_regression <- FALSE; glb_is_classification <- !glb_is_regression; 
    glb_is_binomial <- TRUE # or TRUE or FALSE

glb_rsp_var_raw <- "Party"

# for classification, the response variable has to be a factor
glb_rsp_var <- "Party.fctr"

# if the response factor is based on numbers/logicals e.g (0/1 OR TRUE/FALSE vs. "A"/"B"), 
#   or contains spaces (e.g. "Not in Labor Force")
#   caret predict(..., type="prob") crashes
glb_map_rsp_raw_to_var <- #NULL 
function(raw) {
#     return(raw ^ 0.5)
#     return(log(raw))
#     return(log(1 + raw))
#     return(log10(raw)) 
#     return(exp(-raw / 2))
#     
# chk ref value against frequencies vs. alpha sort order
    ret_vals <- rep_len(NA, length(raw)); ret_vals[!is.na(raw)] <- ifelse(raw[!is.na(raw)] == "Republican", "R", "D"); return(relevel(as.factor(ret_vals), ref = "D")) 
    
#     as.factor(paste0("B", raw))
#     as.factor(gsub(" ", "\\.", raw))
    }

#if glb_rsp_var_raw is numeric:
#print(summary(glbObsAll[, glb_rsp_var_raw]))
#glb_map_rsp_raw_to_var(tst <- c(NA, as.numeric(summary(glbObsAll[, glb_rsp_var_raw])))) 

#if glb_rsp_var_raw is character:
#print(table(glbObsAll[, glb_rsp_var_raw], useNA = "ifany"))
# print(table(glb_map_rsp_raw_to_var(tst <- glbObsAll[, glb_rsp_var_raw]), useNA = "ifany"))

glb_map_rsp_var_to_raw <- #NULL 
function(var) {
#     return(var ^ 2.0)
#     return(exp(var))
#     return(10 ^ var) 
#     return(-log(var) * 2)
#     as.numeric(var)
#     levels(var)[as.numeric(var)]
    sapply(levels(var)[as.numeric(var)], function(elm) 
        if (is.na(elm)) return(elm) else
        if (elm == 'R') return("Republican") else
        if (elm == 'D') return("Democrat") else
        stop("glb_map_rsp_var_to_raw: unexpected value: ", elm)
        )  
#     gsub("\\.", " ", levels(var)[as.numeric(var)])
#     c("<=50K", " >50K")[as.numeric(var)]
#     c(FALSE, TRUE)[as.numeric(var)]
}
# print(table(glb_map_rsp_var_to_raw(glb_map_rsp_raw_to_var(tst)), useNA = "ifany"))

if ((glb_rsp_var != glb_rsp_var_raw) && is.null(glb_map_rsp_raw_to_var))
    stop("glb_map_rsp_raw_to_var function expected")

# List info gathered for various columns
# <col_name>:   <description>; <notes>
# USER_ID - an anonymous id unique to a given user
# YOB - the year of birth of the user
# Gender - the gender of the user, either Male or Female
# Income - the household income of the user. Either not provided, or one of "under $25,000", "$25,001 - $50,000", "$50,000 - $74,999", "$75,000 - $100,000", "$100,001 - $150,000", or "over $150,000".
# HouseholdStatus - the household status of the user. Either not provided, or one of "Domestic Partners (no kids)", "Domestic Partners (w/kids)", "Married (no kids)", "Married (w/kids)", "Single (no kids)", or "Single (w/kids)".
# EducationalLevel - the education level of the user. Either not provided, or one of "Current K-12", "High School Diploma", "Current Undergraduate", "Associate's Degree", "Bachelor's Degree", "Master's Degree", or "Doctoral Degree".
# Party - the political party for whom the user intends to vote for. Either "Democrat" or "Republican
# Q124742, Q124122, . . . , Q96024 - 101 different questions that the users were asked on Show of Hands. If the user didn't answer the question, there is a blank. For information about the question text and possible answers, see the file Questions.pdf.

# currently does not handle more than 1 column; consider concatenating multiple columns
# If glbFeatsId == NULL, ".rownames <- as.numeric(row.names())" is the default
glbFeatsId <- "USER_ID" # choose from c(NULL : default, "<id_feat>") 
glbFeatsCategory <- "Hhold.fctr" # choose from c(NULL : default, "<category_feat>")
# glbFeatsCategory <- "Q109244.fctr" # choose from c(NULL : default, "<category_feat>") -> OOB performed worse than "Hhold.fctr"

# User-specified exclusions
glbFeatsExclude <- c(NULL
#   Feats that shd be excluded due to known causation by prediction variable
# , "<feat1", "<feat2>"
#   Feats that are factors with unique values (as % of nObs) > 49 (empirically derived)
#   Feats that are linear combinations (alias in glm)
#   Feature-engineering phase -> start by excluding all features except id & category & 
#       work each one in
    , "USER_ID", "YOB", "Gender", "Income", "HouseholdStatus", "EducationLevel" 
    ,"Q124742","Q124122" 
    ,"Q123621","Q123464"
    ,"Q122771","Q122770","Q122769","Q122120"
    ,"Q121700","Q121699","Q121011"
    ,"Q120978","Q120650","Q120472","Q120379","Q120194","Q120014","Q120012" 
    ,"Q119851","Q119650","Q119334"
    ,"Q118892","Q118237","Q118233","Q118232","Q118117"
    ,"Q117193","Q117186"
    ,"Q116797","Q116881","Q116953","Q116601","Q116441","Q116448","Q116197"
    ,"Q115602","Q115777","Q115610","Q115611","Q115899","Q115390","Q115195"
    ,"Q114961","Q114748","Q114517","Q114386","Q114152"
    ,"Q113992","Q113583","Q113584","Q113181"
    ,"Q112478","Q112512","Q112270"
    ,"Q111848","Q111580","Q111220"
    ,"Q110740"
    ,"Q109367","Q109244"
    ,"Q108950","Q108855","Q108617","Q108856","Q108754","Q108342","Q108343"
    ,"Q107869","Q107491"
    ,"Q106993","Q106997","Q106272","Q106388","Q106389","Q106042"
    ,"Q105840","Q105655"
    ,"Q104996"
    ,"Q103293"
    ,"Q102906","Q102674","Q102687","Q102289","Q102089"
    ,"Q101162","Q101163","Q101596"
    ,"Q100689","Q100680","Q100562","Q100010"
    ,"Q99982"
    ,"Q99716"
    ,"Q99581"
    ,"Q99480"
    ,"Q98869"
    ,"Q98578"
    ,"Q98197"
    ,"Q98059","Q98078"
    ,"Q96024" # Done
    ,".pos") 
if (glb_rsp_var_raw != glb_rsp_var)
    glbFeatsExclude <- union(glbFeatsExclude, glb_rsp_var_raw)                    

glbFeatsInteractionOnly <- list()
#glbFeatsInteractionOnly[["<child_feat>"]] <- "<parent_feat>"
glbFeatsInteractionOnly[["YOB.Age.dff"]] <- "YOB.Age.fctr"

glbFeatsDrop <- c(NULL
                # , "<feat1>", "<feat2>"
                )

glb_map_vars <- NULL # or c("<var1>", "<var2>")
glb_map_urls <- list();
# glb_map_urls[["<var1>"]] <- "<var1.url>"

# Derived features; Use this mechanism to cleanse data ??? Cons: Data duplication ???
glbFeatsDerive <- list();

# glbFeatsDerive[["<feat.my.sfx>"]] <- list(
#     mapfn = function(<arg1>, <arg2>) { return(function(<arg1>, <arg2>)) } 
#   , args = c("<arg1>", "<arg2>"))
#myprint_df(data.frame(ImageId = mapfn(glbObsAll$.src, glbObsAll$.pos)))
#data.frame(ImageId = mapfn(glbObsAll$.src, glbObsAll$.pos))[7045:7055, ]

    # character
#     mapfn = function(Education) { raw <- Education; raw[is.na(raw)] <- "NA.my"; return(as.factor(raw)) } 
#     mapfn = function(Week) { return(substr(Week, 1, 10)) }
#     mapfn = function(Name) { return(sapply(Name, function(thsName) 
#                                             str_sub(unlist(str_split(thsName, ","))[1], 1, 1))) } 

#     mapfn = function(descriptor) { return(plyr::revalue(descriptor, c(
#         "ABANDONED BUILDING"  = "OTHER",
#         "**"                  = "**"
#                                           ))) }

#     mapfn = function(description) { mod_raw <- description;
    # This is here because it does not work if it's in txt_map_filename
#         mod_raw <- gsub(paste0(c("\n", "\211", "\235", "\317", "\333"), collapse = "|"), " ", mod_raw)
    # Don't parse for "." because of ".com"; use customized gsub for that text
#         mod_raw <- gsub("(\\w)(!|\\*|,|-|/)(\\w)", "\\1\\2 \\3", mod_raw);
    # Some state acrnoyms need context for separation e.g. 
    #   LA/L.A. could either be "Louisiana" or "LosAngeles"
        # modRaw <- gsub("\\bL\\.A\\.( |,|')", "LosAngeles\\1", modRaw);
    #   OK/O.K. could either be "Oklahoma" or "Okay"
#         modRaw <- gsub("\\bACA OK\\b", "ACA OKay", modRaw); 
#         modRaw <- gsub("\\bNow O\\.K\\.\\b", "Now OKay", modRaw);        
    #   PR/P.R. could either be "PuertoRico" or "Public Relations"        
        # modRaw <- gsub("\\bP\\.R\\. Campaign", "PublicRelations Campaign", modRaw);        
    #   VA/V.A. could either be "Virginia" or "VeteransAdministration"        
        # modRaw <- gsub("\\bthe V\\.A\\.\\:", "the VeteranAffairs:", modRaw);
    #   
    # Custom mods

#         return(mod_raw) }

    # numeric
# Create feature based on record position/id in data   
glbFeatsDerive[[".pos"]] <- list(
    mapfn = function(raw1) { return(1:length(raw1)) }
    , args = c(".rnorm"))
# glbFeatsDerive[[".pos.y"]] <- list(
#     mapfn = function(raw1) { return(1:length(raw1)) }       
#     , args = c(".rnorm"))    

# Add logs of numerics that are not distributed normally
#   Derive & keep multiple transformations of the same feature, if normality is hard to achieve with just one transformation
#   Right skew: logp1; sqrt; ^ 1/3; logp1(logp1); log10; exp(-<feat>/constant)
# glbFeatsDerive[["WordCount.log1p"]] <- list(
#     mapfn = function(WordCount) { return(log1p(WordCount)) } 
#   , args = c("WordCount"))
# glbFeatsDerive[["WordCount.root2"]] <- list(
#     mapfn = function(WordCount) { return(WordCount ^ (1/2)) } 
#   , args = c("WordCount"))
# glbFeatsDerive[["WordCount.nexp"]] <- list(
#     mapfn = function(WordCount) { return(exp(-WordCount)) } 
#   , args = c("WordCount"))
#print(summary(glbObsAll$WordCount))
#print(summary(mapfn(glbObsAll$WordCount)))
    
# If imputation shd be skipped for this feature
# glbFeatsDerive[["District.fctr"]] <- list(
#     mapfn = function(District) {
#         raw <- District;
#         ret_vals <- rep_len("NA", length(raw)); 
#         ret_vals[!is.na(raw)] <- sapply(raw[!is.na(raw)], function(elm) 
#                                         ifelse(elm < 10, "1-9", 
#                                         ifelse(elm < 20, "10-19", "20+")));
#         return(relevel(as.factor(ret_vals), ref = "NA"))
#     }       
#     , args = c("District"))    

# YOB options:
# 1. Missing data:
# 1.1   0 -> Does not improve baseline
# 1.2   Cut factors & "NA" is a level
# 2. Data corrections: < 1928 & > 2000
# 3. Scale YOB
# 4. Add Age
# YOB.Age.fctr needs to be synced with YOB.Age.dff; Create a separate sub-function ???
glbFeatsDerive[["YOB.Age.fctr"]] <- list(
    mapfn = function(raw1) {
        raw <- 2016 - raw1 
        # raw[!is.na(raw) & raw >= 2010] <- NA
        raw[!is.na(raw) & (raw <= 15)] <- NA
        raw[!is.na(raw) & (raw >= 90)] <- NA        
        retVal <- rep_len("NA", length(raw))
        # breaks = c(1879, seq(1949, 1989, 10), 2049)
        # cutVal <- cut(raw[!is.na(raw)], breaks = breaks, 
        #               labels = as.character(breaks + 1)[1:(length(breaks) - 1)])
        cutVal <- cut(raw[!is.na(raw)], breaks = c(15, 20, 25, 30, 35, 40, 50, 65, 90))
        retVal[!is.na(raw)] <- levels(cutVal)[cutVal]
        return(factor(retVal, levels = c("NA"
                ,"(15,20]","(20,25]","(25,30]","(30,35]","(35,40]","(40,50]","(50,65]","(65,90]"),
                        ordered = TRUE))
    }
    , args = c("YOB"))

# YOB.Age.fctr needs to be synced with YOB.Age.dff; Create a separate sub-function ???
glbFeatsDerive[["YOB.Age.dff"]] <- list(
    mapfn = function(raw1) {
        raw <- 2016 - raw1 
        raw[!is.na(raw) & (raw <= 15)] <- NA
        raw[!is.na(raw) & (raw >= 90)] <- NA        
        breaks <- c(15, 20, 25, 30, 35, 40, 50, 65, 90)

        # retVal <- rep_len(0, length(raw))
        stopifnot(sum(!is.na(raw) && (raw <= 15)) == 0)
        stopifnot(sum(!is.na(raw) && (raw >= 90)) == 0) 
        # msk <- !is.na(raw) && (raw > 15) && (raw <= 20); if (sum(msk > 0)) retVal[msk] <- raw[msk] - 15
        # msk <- !is.na(raw) && (raw > 20) && (raw <= 25); if (sum(msk > 0)) retVal[msk] <- raw[msk] - 20
        # msk <- !is.na(raw) && (raw > 25) && (raw <= 30); if (sum(msk > 0)) retVal[msk] <- raw[msk] - 25
        # msk <- !is.na(raw) && (raw > 30) && (raw <= 35); if (sum(msk > 0)) retVal[msk] <- raw[msk] - 30
        # msk <- !is.na(raw) && (raw > 35) && (raw <= 40); if (sum(msk > 0)) retVal[msk] <- raw[msk] - 35
        # msk <- !is.na(raw) && (raw > 40) && (raw <= 50); if (sum(msk > 0)) retVal[msk] <- raw[msk] - 40
        # msk <- !is.na(raw) && (raw > 50) && (raw <= 65); if (sum(msk > 0)) retVal[msk] <- raw[msk] - 50
        # msk <- !is.na(raw) && (raw > 65) && (raw <= 90); if (sum(msk > 0)) retVal[msk] <- raw[msk] - 65

        breaks <- c(15, 20, 25, 30, 35, 40, 50, 65, 90)        
        retVal <- sapply(raw, function(age) {
            if (is.na(age)) return(0) else
            if ((age > 15) && (age <= 20)) return(age - 15) else
            if ((age > 20) && (age <= 25)) return(age - 20) else
            if ((age > 25) && (age <= 30)) return(age - 25) else
            if ((age > 30) && (age <= 35)) return(age - 30) else
            if ((age > 35) && (age <= 40)) return(age - 35) else
            if ((age > 40) && (age <= 50)) return(age - 40) else
            if ((age > 50) && (age <= 65)) return(age - 50) else
            if ((age > 65) && (age <= 90)) return(age - 65)
        })
        
        return(retVal)
    }
    , args = c("YOB"))

glbFeatsDerive[["Gender.fctr"]] <- list(
    mapfn = function(raw1) {
        raw <- raw1
        raw[raw %in% ""] <- "N"
        raw <- gsub("Male"  , "M", raw, fixed = TRUE)
        raw <- gsub("Female", "F", raw, fixed = TRUE)        
        return(relevel(as.factor(raw), ref = "N"))
    }
    , args = c("Gender"))

glbFeatsDerive[["Income.fctr"]] <- list(
    mapfn = function(raw1) { raw <- raw1;
        raw[raw %in% ""] <- "N"
        raw <- gsub("under $25,000"      , "<25K"    , raw, fixed = TRUE)
        raw <- gsub("$25,001 - $50,000"  , "25-50K"  , raw, fixed = TRUE)
        raw <- gsub("$50,000 - $74,999"  , "50-75K"  , raw, fixed = TRUE)
        raw <- gsub("$75,000 - $100,000" , "75-100K" , raw, fixed = TRUE)        
        raw <- gsub("$100,001 - $150,000", "100-150K", raw, fixed = TRUE)
        raw <- gsub("over $150,000"      , ">150K"   , raw, fixed = TRUE)        
        return(factor(raw, levels = c("N","<25K","25-50K","50-75K","75-100K","100-150K",">150K"),
                      ordered = TRUE))
    }
    , args = c("Income"))

glbFeatsDerive[["Hhold.fctr"]] <- list(
    mapfn = function(raw1) { raw <- raw1;
        raw[raw %in% ""] <- "N"
        raw <- gsub("Domestic Partners (no kids)", "PKn", raw, fixed = TRUE)
        raw <- gsub("Domestic Partners (w/kids)" , "PKy", raw, fixed = TRUE)        
        raw <- gsub("Married (no kids)"          , "MKn", raw, fixed = TRUE)
        raw <- gsub("Married (w/kids)"           , "MKy", raw, fixed = TRUE)        
        raw <- gsub("Single (no kids)"           , "SKn", raw, fixed = TRUE)
        raw <- gsub("Single (w/kids)"            , "SKy", raw, fixed = TRUE)        
        return(relevel(as.factor(raw), ref = "N"))
    }
    , args = c("HouseholdStatus"))

glbFeatsDerive[["Edn.fctr"]] <- list(
    mapfn = function(raw1) { raw <- raw1;
        raw[raw %in% ""] <- "N"
        raw <- gsub("Current K-12"         , "K12", raw, fixed = TRUE)
        raw <- gsub("High School Diploma"  , "HSD", raw, fixed = TRUE)        
        raw <- gsub("Current Undergraduate", "CCg", raw, fixed = TRUE)
        raw <- gsub("Associate's Degree"   , "Ast", raw, fixed = TRUE)
        raw <- gsub("Bachelor's Degree"    , "Bcr", raw, fixed = TRUE)        
        raw <- gsub("Master's Degree"      , "Msr", raw, fixed = TRUE)
        raw <- gsub("Doctoral Degree"      , "PhD", raw, fixed = TRUE)        
        return(factor(raw, levels = c("N","K12","HSD","CCg","Ast","Bcr","Msr","PhD"),
                      ordered = TRUE))
    }
    , args = c("EducationLevel"))

# for (qsn in c("Q124742","Q124122"))
# for (qsn in grep("Q12(.{4})(?!\\.fctr)", names(glbObsTrn), value = TRUE, perl = TRUE))
for (qsn in grep("Q", glbFeatsExclude, fixed = TRUE, value = TRUE))    
    glbFeatsDerive[[paste0(qsn, ".fctr")]] <- list(
        mapfn = function(raw1) {
            raw1[raw1 %in% ""] <- "NA"
            rawVal <- unique(raw1)
            
            if (length(setdiff(rawVal, (expVal <- c("NA", "No", "Ys")))) == 0) {
                raw1 <- gsub("Yes", "Ys", raw1, fixed = TRUE)
                if (length(setdiff(rawVal, expVal)) > 0)
                    stop(qsn, " vals: ", paste0(rawVal, collapse = "|"), 
                         " does not match expectation: ", paste0(expVal, collapse = "|"))
            } else
            if (length(setdiff(rawVal, (expVal <- c("NA", "Me", "Circumstances")))) == 0) {
                raw1 <- gsub("Circumstances", "Cs", raw1, fixed = TRUE)
                if (length(setdiff(rawVal, expVal)) > 0)
                    stop(qsn, " vals: ", paste0(rawVal, collapse = "|"), 
                         " does not match expectation: ", paste0(expVal, collapse = "|"))
            } else
            if (length(setdiff(rawVal, (expVal <- c("NA", "Grrr people", "Yay people!")))) == 0) {
                raw1 <- gsub("Grrr people", "Gr", raw1, fixed = TRUE)
                raw1 <- gsub("Yay people!", "Yy", raw1, fixed = TRUE)                
                if (length(setdiff(rawVal, expVal)) > 0)
                    stop(qsn, " vals: ", paste0(rawVal, collapse = "|"), 
                         " does not match expectation: ", paste0(expVal, collapse = "|"))
            } else
            if (length(setdiff(rawVal, (expVal <- c("NA", "Idealist", "Pragmatist")))) == 0) {
                raw1 <- gsub("Idealist"  , "Id", raw1, fixed = TRUE)
                raw1 <- gsub("Pragmatist", "Pr", raw1, fixed = TRUE)                
                if (length(setdiff(rawVal, expVal)) > 0)
                    stop(qsn, " vals: ", paste0(rawVal, collapse = "|"), 
                         " does not match expectation: ", paste0(expVal, collapse = "|"))
            } else
            if (length(setdiff(rawVal, (expVal <- c("NA", "Private", "Public")))) == 0) {
                raw1 <- gsub("Private", "Pt", raw1, fixed = TRUE)
                raw1 <- gsub("Public" , "Pc", raw1, fixed = TRUE)                
                if (length(setdiff(rawVal, expVal)) > 0)
                    stop(qsn, " vals: ", paste0(rawVal, collapse = "|"), 
                         " does not match expectation: ", paste0(expVal, collapse = "|"))
            }
            
            return(relevel(as.factor(raw1), ref = "NA"))
        }
        , args = c(qsn))

# If imputation of missing data is not working ...
# glbFeatsDerive[["FertilityRate.nonNA"]] <- list(
#     mapfn = function(FertilityRate, Region) {
#         RegionMdn <- tapply(FertilityRate, Region, FUN = median, na.rm = TRUE)
# 
#         retVal <- FertilityRate
#         retVal[is.na(FertilityRate)] <- RegionMdn[Region[is.na(FertilityRate)]]
#         return(retVal)
#     }
#     , args = c("FertilityRate", "Region"))
    
#     mapfn = function(HOSPI.COST) { return(cut(HOSPI.COST, 5, breaks = c(0, 100000, 200000, 300000, 900000), labels = NULL)) }     
#     mapfn = function(Rasmussen)  { return(ifelse(sign(Rasmussen) >= 0, 1, 0)) } 
#     mapfn = function(startprice) { return(startprice ^ (1/2)) }       
#     mapfn = function(startprice) { return(log(startprice)) }   
#     mapfn = function(startprice) { return(exp(-startprice / 20)) }
#     mapfn = function(startprice) { return(scale(log(startprice))) }     
#     mapfn = function(startprice) { return(sign(sprice.predict.diff) * (abs(sprice.predict.diff) ^ (1/10))) }        

    # factor      
#     mapfn = function(PropR) { return(as.factor(ifelse(PropR >= 0.5, "Y", "N"))) }
#     mapfn = function(productline, description) { as.factor(gsub(" ", "", productline)) }
#     mapfn = function(purpose) { return(relevel(as.factor(purpose), ref="all_other")) }
#     mapfn = function(raw) { tfr_raw <- as.character(cut(raw, 5)); 
#                             tfr_raw[is.na(tfr_raw)] <- "NA.my";
#                             return(as.factor(tfr_raw)) }
#     mapfn = function(startprice.log10) { return(cut(startprice.log10, 3)) }
#     mapfn = function(startprice.log10) { return(cut(sprice.predict.diff, c(-1000, -100, -10, -1, 0, 1, 10, 100, 1000))) }    

#     , args = c("<arg1>"))
    
    # multiple args
#     mapfn = function(id, date) { return(paste(as.character(id), as.character(date), sep = "#")) }        
#     mapfn = function(PTS, oppPTS) { return(PTS - oppPTS) }
#     mapfn = function(startprice.log10.predict, startprice) {
#                  return(spdiff <- (10 ^ startprice.log10.predict) - startprice) } 
#     mapfn = function(productline, description) { as.factor(
#         paste(gsub(" ", "", productline), as.numeric(nchar(description) > 0), sep = "*")) }
#     mapfn = function(.src, .pos) { 
#         return(paste(.src, sprintf("%04d", 
#                                    ifelse(.src == "Train", .pos, .pos - 7049)
#                                    ), sep = "#")) }       

# # If glbObsAll is not sorted in the desired manner
#     mapfn=function(Week) { return(coredata(lag(zoo(orderBy(~Week, glbObsAll)$ILI), -2, na.pad=TRUE))) }
#     mapfn=function(ILI) { return(coredata(lag(zoo(ILI), -2, na.pad=TRUE))) }
#     mapfn=function(ILI.2.lag) { return(log(ILI.2.lag)) }

# glbFeatsDerive[["<var1>"]] <- glbFeatsDerive[["<var2>"]]

# tst <- "descr.my"; args_lst <- NULL; for (arg in glbFeatsDerive[[tst]]$args) args_lst[[arg]] <- glbObsAll[, arg]; print(head(args_lst[[arg]])); print(head(drv_vals <- do.call(glbFeatsDerive[[tst]]$mapfn, args_lst))); 
# print(which_ix <- which(args_lst[[arg]] == 0.75)); print(drv_vals[which_ix]); 

glbFeatsDateTime <- list()
# Use OlsonNames() to enumerate supported time zones
# glbFeatsDateTime[["<DateTimeFeat>"]] <- 
#     c(format = "%Y-%m-%d %H:%M:%S" or "%m/%e/%y", timezone = "US/Eastern", impute.na = TRUE, 
#       last.ctg = FALSE, poly.ctg = FALSE)

glbFeatsPrice <- NULL # or c("<price_var>")

glbFeatsImage <- list() #list(<imageFeat> = list(patchSize = 10)) # if patchSize not specified, no patch computation

glbFeatsText <- list()
Sys.setlocale("LC_ALL", "C") # For english
## [1] "C/C/C/C/C/en_US.UTF-8"
#glbFeatsText[["<TextFeature>"]] <- list(NULL,
#   ,names = myreplacePunctuation(str_to_lower(gsub(" ", "", c(NULL, 
#       <comma-separated-screened-names>
#   ))))
#   ,rareWords = myreplacePunctuation(str_to_lower(gsub(" ", "", c(NULL, 
#       <comma-separated-nonSCOWL-words>
#   ))))
#)

# Text Processing Step: custom modifications not present in txt_munge -> use glbFeatsDerive
# Text Processing Step: universal modifications
glb_txt_munge_filenames_pfx <- "<projectId>_mytxt_"

# Text Processing Step: tolower
# Text Processing Step: myreplacePunctuation
# Text Processing Step: removeWords
glb_txt_stop_words <- list()
# Remember to use unstemmed words
if (length(glbFeatsText) > 0) {
    require(tm)
    require(stringr)

    glb_txt_stop_words[["<txt_var>"]] <- sort(myreplacePunctuation(str_to_lower(gsub(" ", "", c(NULL
        # Remove any words from stopwords            
#         , setdiff(myreplacePunctuation(stopwords("english")), c("<keep_wrd1>", <keep_wrd2>"))
                                
        # Remove salutations
        ,"mr","mrs","dr","Rev"                                

        # Remove misc
        #,"th" # Happy [[:digit::]]+th birthday 

        # Remove terms present in Trn only or New only; search for "Partition post-stem"
        #   ,<comma-separated-terms>        

        # cor.y.train == NA
#         ,unlist(strsplit(paste(c(NULL
#           ,"<comma-separated-terms>"
#         ), collapse=",")

        # freq == 1; keep c("<comma-separated-terms-to-keep>")
            # ,<comma-separated-terms>

        # chisq.pval high (e.g. == 1); keep c("<comma-separated-terms-to-keep>")
            # ,<comma-separated-terms>

        # nzv.freqRatio high (e.g. >= glbFeatsNzvFreqMax); keep c("<comma-separated-terms-to-keep>")
            # ,<comma-separated-terms>        
                                            )))))
}
#orderBy(~term, glb_post_stem_words_terms_df_lst[[txtFeat]][grep("^man", glb_post_stem_words_terms_df_lst[[txtFeat]]$term), ])
#glbObsAll[glb_post_stem_words_terms_mtrx_lst[[txtFeat]][, 4866] > 0, c(glb_rsp_var, txtFeat)]

# To identify terms with a specific freq
#paste0(sort(subset(glb_post_stop_words_terms_df_lst[[txtFeat]], freq == 1)$term), collapse = ",")
#paste0(sort(subset(glb_post_stem_words_terms_df_lst[[txtFeat]], freq <= 2)$term), collapse = ",")
#subset(glb_post_stem_words_terms_df_lst[[txtFeat]], term %in% c("zinger"))

# To identify terms with a specific freq & 
#   are not stemmed together later OR is value of color.fctr (e.g. gold)
#paste0(sort(subset(glb_post_stop_words_terms_df_lst[[txtFeat]], (freq == 1) & !(term %in% c("blacked","blemish","blocked","blocks","buying","cables","careful","carefully","changed","changing","chargers","cleanly","cleared","connect","connects","connected","contains","cosmetics","default","defaulting","defective","definitely","describe","described","devices","displays","drop","drops","engravement","excellant","excellently","feels","fix","flawlessly","frame","framing","gentle","gold","guarantee","guarantees","handled","handling","having","install","iphone","iphones","keeped","keeps","known","lights","line","lining","liquid","liquidation","looking","lots","manuals","manufacture","minis","most","mostly","network","networks","noted","opening","operated","performance","performs","person","personalized","photograph","physically","placed","places","powering","pre","previously","products","protection","purchasing","returned","rotate","rotation","running","sales","second","seconds","shipped","shuts","sides","skin","skinned","sticker","storing","thats","theres","touching","unusable","update","updates","upgrade","weeks","wrapped","verified","verify") ))$term), collapse = ",")

#print(subset(glb_post_stem_words_terms_df_lst[[txtFeat]], (freq <= 2)))
#glbObsAll[which(terms_mtrx[, 229] > 0), glbFeatsText]

# To identify terms with cor.y == NA
#orderBy(~-freq+term, subset(glb_post_stop_words_terms_df_lst[[txtFeat]], is.na(cor.y)))
#paste(sort(subset(glb_post_stop_words_terms_df_lst[[txtFeat]], is.na(cor.y))[, "term"]), collapse=",")
#orderBy(~-freq+term, subset(glb_post_stem_words_terms_df_lst[[txtFeat]], is.na(cor.y)))

# To identify terms with low cor.y.abs
#head(orderBy(~cor.y.abs+freq+term, subset(glb_post_stem_words_terms_df_lst[[txtFeat]], !is.na(cor.y))), 5)

# To identify terms with high chisq.pval
#subset(glb_post_stem_words_terms_df_lst[[txtFeat]], chisq.pval > 0.99)
#paste0(sort(subset(glb_post_stem_words_terms_df_lst[[txtFeat]], (chisq.pval > 0.99) & (freq <= 10))$term), collapse=",")
#paste0(sort(subset(glb_post_stem_words_terms_df_lst[[txtFeat]], (chisq.pval > 0.9))$term), collapse=",")
#head(orderBy(~-chisq.pval+freq+term, glb_post_stem_words_terms_df_lst[[txtFeat]]), 5)
#glbObsAll[glb_post_stem_words_terms_mtrx_lst[[txtFeat]][, 68] > 0, glbFeatsText]
#orderBy(~term, glb_post_stem_words_terms_df_lst[[txtFeat]][grep("^m", glb_post_stem_words_terms_df_lst[[txtFeat]]$term), ])

# To identify terms with high nzv.freqRatio
#summary(glb_post_stem_words_terms_df_lst[[txtFeat]]$nzv.freqRatio)
#paste0(sort(setdiff(subset(glb_post_stem_words_terms_df_lst[[txtFeat]], (nzv.freqRatio >= glbFeatsNzvFreqMax) & (freq < 10) & (chisq.pval >= 0.05))$term, c( "128gb","3g","4g","gold","ipad1","ipad3","ipad4","ipadair2","ipadmini2","manufactur","spacegray","sprint","tmobil","verizon","wifion"))), collapse=",")

# To identify obs with a txt term
#tail(orderBy(~-freq+term, glb_post_stop_words_terms_df_lst[[txtFeat]]), 20)
#mydspObs(list(descr.my.contains="non"), cols=c("color", "carrier", "cellular", "storage"))
#grep("ever", dimnames(terms_stop_mtrx)$Terms)
#which(terms_stop_mtrx[, grep("ipad", dimnames(terms_stop_mtrx)$Terms)] > 0)
#glbObsAll[which(terms_stop_mtrx[, grep("16", dimnames(terms_stop_mtrx)$Terms)[1]] > 0), c(glbFeatsCategory, "storage", txtFeat)]

# Text Processing Step: screen for names # Move to glbFeatsText specs section in order of text processing steps
# glbFeatsText[["<txtFeat>"]]$names <- myreplacePunctuation(str_to_lower(gsub(" ", "", c(NULL
#         # Person names for names screening
#         ,<comma-separated-list>
#         
#         # Company names
#         ,<comma-separated-list>
#                     
#         # Product names
#         ,<comma-separated-list>
#     ))))

# glbFeatsText[["<txtFeat>"]]$rareWords <- myreplacePunctuation(str_to_lower(gsub(" ", "", c(NULL
#         # Words not in SCOWL db
#         ,<comma-separated-list>
#     ))))

# To identify char vectors post glbFeatsTextMap
#grep("six(.*)hour", glb_txt_chr_lst[[txtFeat]], ignore.case = TRUE, value = TRUE)
#grep("[S|s]ix(.*)[H|h]our", glb_txt_chr_lst[[txtFeat]], value = TRUE)

# To identify whether terms shd be synonyms
#orderBy(~term, glb_post_stop_words_terms_df_lst[[txtFeat]][grep("^moder", glb_post_stop_words_terms_df_lst[[txtFeat]]$term), ])
# term_row_df <- glb_post_stop_words_terms_df_lst[[txtFeat]][grep("^came$", glb_post_stop_words_terms_df_lst[[txtFeat]]$term), ]
# 
# cor(glb_post_stop_words_terms_mtrx_lst[[txtFeat]][glbObsAll$.lcn == "Fit", term_row_df$pos], glbObsTrn[, glb_rsp_var], use="pairwise.complete.obs")

# To identify which stopped words are "close" to a txt term
#sort(glbFeatsCluster)

# Text Processing Step: stemDocument
# To identify stemmed txt terms
#glb_post_stop_words_terms_df_lst[[txtFeat]][grep("^la$", glb_post_stop_words_terms_df_lst[[txtFeat]]$term), ]
#orderBy(~term, glb_post_stem_words_terms_df_lst[[txtFeat]][grep("^con", glb_post_stem_words_terms_df_lst[[txtFeat]]$term), ])
#glbObsAll[which(terms_stem_mtrx[, grep("use", dimnames(terms_stem_mtrx)$Terms)[[1]]] > 0), c(glbFeatsId, "productline", txtFeat)]
#glbObsAll[which(TfIdf_stem_mtrx[, 191] > 0), c(glbFeatsId, glbFeatsCategory, txtFeat)]
#glbObsAll[which(glb_post_stop_words_terms_mtrx_lst[[txtFeat]][, 6165] > 0), c(glbFeatsId, glbFeatsCategory, txtFeat)]
#which(glbObsAll$UniqueID %in% c(11915, 11926, 12198))

# Text Processing Step: mycombineSynonyms
#   To identify which terms are associated with not -> combine "could not" & "couldn't"
#findAssocs(glb_full_DTM_lst[[txtFeat]], "not", 0.05)
#   To identify which synonyms should be combined
#orderBy(~term, glb_post_stem_words_terms_df_lst[[txtFeat]][grep("^c", glb_post_stem_words_terms_df_lst[[txtFeat]]$term), ])
chk_comb_cor <- function(syn_lst) {
#     cor(terms_stem_mtrx[glbObsAll$.src == "Train", grep("^(damag|dent|ding)$", dimnames(terms_stem_mtrx)[[2]])], glbObsTrn[, glb_rsp_var], use="pairwise.complete.obs")
    print(subset(glb_post_stem_words_terms_df_lst[[txtFeat]], term %in% syn_lst$syns))
    print(subset(get_corpus_terms(tm_map(glbFeatsTextCorpus[[txtFeat]], mycombineSynonyms, list(syn_lst), lazy=FALSE)), term == syn_lst$word))
#     cor(terms_stop_mtrx[glbObsAll$.src == "Train", grep("^(damage|dent|ding)$", dimnames(terms_stop_mtrx)[[2]])], glbObsTrn[, glb_rsp_var], use="pairwise.complete.obs")
#     cor(rowSums(terms_stop_mtrx[glbObsAll$.src == "Train", grep("^(damage|dent|ding)$", dimnames(terms_stop_mtrx)[[2]])]), glbObsTrn[, glb_rsp_var], use="pairwise.complete.obs")
}
#chk_comb_cor(syn_lst=list(word="cabl",  syns=c("cabl", "cord")))
#chk_comb_cor(syn_lst=list(word="damag",  syns=c("damag", "dent", "ding")))
#chk_comb_cor(syn_lst=list(word="dent",  syns=c("dent", "ding")))
#chk_comb_cor(syn_lst=list(word="use",  syns=c("use", "usag")))

glbFeatsTextSynonyms <- list()
# list parsed to collect glbFeatsText[[<txtFeat>]]$vldTerms
# glbFeatsTextSynonyms[["Hdln.my"]] <- list(NULL
#     # people in places
#     , list(word = "australia", syns = c("australia", "australian"))
#     , list(word = "italy", syns = c("italy", "Italian"))
#     , list(word = "newyork", syns = c("newyork", "newyorker"))    
#     , list(word = "Pakistan", syns = c("Pakistan", "Pakistani"))    
#     , list(word = "peru", syns = c("peru", "peruvian"))
#     , list(word = "qatar", syns = c("qatar", "qatari"))
#     , list(word = "scotland", syns = c("scotland", "scotish"))
#     , list(word = "Shanghai", syns = c("Shanghai", "Shanzhai"))    
#     , list(word = "venezuela", syns = c("venezuela", "venezuelan"))    
# 
#     # companies - needs to be data dependent 
#     #   - e.g. ensure BNP in this experiment/feat always refers to BNPParibas
#         
#     # general synonyms
#     , list(word = "Create", syns = c("Create","Creator")) 
#     , list(word = "cute", syns = c("cute","cutest"))     
#     , list(word = "Disappear", syns = c("Disappear","Fadeout"))     
#     , list(word = "teach", syns = c("teach", "taught"))     
#     , list(word = "theater",  syns = c("theater", "theatre", "theatres")) 
#     , list(word = "understand",  syns = c("understand", "understood"))    
#     , list(word = "weak",  syns = c("weak", "weaken", "weaker", "weakest"))
#     , list(word = "wealth",  syns = c("wealth", "wealthi"))    
#     
#     # custom synonyms (phrases)
#     
#     # custom synonyms (names)
#                                       )
#glbFeatsTextSynonyms[["<txtFeat>"]] <- list(NULL
#     , list(word="<stem1>",  syns=c("<stem1>", "<stem1_2>"))
#                                       )

for (txtFeat in names(glbFeatsTextSynonyms))
    for (entryIx in 1:length(glbFeatsTextSynonyms[[txtFeat]])) {
        glbFeatsTextSynonyms[[txtFeat]][[entryIx]]$word <-
            str_to_lower(glbFeatsTextSynonyms[[txtFeat]][[entryIx]]$word)
        glbFeatsTextSynonyms[[txtFeat]][[entryIx]]$syns <-
            str_to_lower(glbFeatsTextSynonyms[[txtFeat]][[entryIx]]$syns)        
    }        

glbFeatsTextSeed <- 181
# tm options include: check tm::weightSMART 
glb_txt_terms_control <- list( # Gather model performance & run-time stats
                    # weighting = function(x) weightSMART(x, spec = "nnn")
                    # weighting = function(x) weightSMART(x, spec = "lnn")
                    # weighting = function(x) weightSMART(x, spec = "ann")
                    # weighting = function(x) weightSMART(x, spec = "bnn")
                    # weighting = function(x) weightSMART(x, spec = "Lnn")
                    # 
                    weighting = function(x) weightSMART(x, spec = "ltn") # default
                    # weighting = function(x) weightSMART(x, spec = "lpn")                    
                    # 
                    # weighting = function(x) weightSMART(x, spec = "ltc")                    
                    # 
                    # weighting = weightBin 
                    # weighting = weightTf 
                    # weighting = weightTfIdf # : default
                # termFreq selection criteria across obs: tm default: list(global=c(1, Inf))
                    , bounds = list(global = c(1, Inf)) 
                # wordLengths selection criteria: tm default: c(3, Inf)
                    , wordLengths = c(1, Inf) 
                              ) 

glb_txt_cor_var <- glb_rsp_var # : default # or c(<feat>)

# select one from c("union.top.val.cor", "top.cor", "top.val", default: "top.chisq", "sparse")
glbFeatsTextFilter <- "top.chisq" 
glbFeatsTextTermsMax <- rep(10, length(glbFeatsText)) # :default
names(glbFeatsTextTermsMax) <- names(glbFeatsText)

# Text Processing Step: extractAssoc
glbFeatsTextAssocCor <- rep(1, length(glbFeatsText)) # :default 
names(glbFeatsTextAssocCor) <- names(glbFeatsText)

# Remember to use stemmed terms
glb_important_terms <- list()

# Text Processing Step: extractPatterns (ngrams)
glbFeatsTextPatterns <- list()
#glbFeatsTextPatterns[[<txtFeat>>]] <- list()
#glbFeatsTextPatterns[[<txtFeat>>]] <- c(metropolitan.diary.colon = "Metropolitan Diary:")

# Have to set it even if it is not used
# Properties:
#   numrows(glb_feats_df) << numrows(glbObsFit
#   Select terms that appear in at least 0.2 * O(FP/FN(glbObsOOB)) ???
#       numrows(glbObsOOB) = 1.1 * numrows(glbObsNew) ???
glb_sprs_thresholds <- NULL # or c(<txtFeat1> = 0.988, <txtFeat2> = 0.970, <txtFeat3> = 0.970)

glbFctrMaxUniqVals <- 20 # default: 20
glb_impute_na_data <- FALSE # or TRUE
glb_mice_complete.seed <- 144 # or any integer

glbFeatsCluster <- paste(grep("^Q.", glbFeatsExclude, value = TRUE), "fctr", sep = ".") # NULL : glbFeatsCluster <- c("YOB.Age.fctr", "Gender.fctr", "Income.fctr", 
                     # # "Hhold.fctr",
                     # "Edn.fctr",
                     # paste(grep("^Q.", glbFeatsExclude, value = TRUE), "fctr", sep = ".")) # NULL : default or c("<feat1>", "<feat2>")
# glbFeatsCluster <- grep(paste0("[", 
#                         toupper(paste0(substr(glbFeatsText, 1, 1), collapse = "")),
#                                       "]\\.[PT]\\."), 
#                                names(glbObsAll), value = TRUE)

glb_cluster.seed <- 189 # or any integer
glbClusterEntropyVar <- NULL # c(glb_rsp_var, as.factor(cut(glb_rsp_var, 3)), default: NULL)
glbFeatsClusterVarsExclude <- FALSE # default FALSE

glb_interaction_only_feats <- NULL # : default or c(<parent_feat> = "<child_feat>")

glbFeatsNzvFreqMax <- 19 # 19 : caret default
glbFeatsNzvUniqMin <- 10 # 10 : caret default

glbRFESizes <- list()
#glbRFESizes[["mdlFamily"]] <- c(4, 8, 16, 32, 64, 67, 68, 69) # Accuracy@69/70 = 0.8258
# glbRFESizes[["RFE.X"]] <- c(96, 112, 120, 124, 128, 129, 130, 131, 132, 133, 135, 138, 142, 157, 187, 247) # accuracy(131) = 0.6285
# glbRFESizes[["Final"]] <- c(8, 16, 32, 40, 44, 46, 48, 49, 50, 51, 52, 56, 64, 96, 128, 247) # accuracy(49) = 0.6164

glbRFEResults <- NULL

glbObsFitOutliers <- list()
# If outliers.n >= 10; consider concatenation of interaction vars
# glbObsFitOutliers[["<mdlFamily>"]] <- c(NULL
#     is.na(.rstudent)
#     max(.rstudent)
#     is.na(.dffits)
#     .hatvalues >= 0.99        
#     -38,167,642 < minmax(.rstudent) < 49,649,823    
#     , <comma-separated-<glbFeatsId>>
#                                     )
glbObsTrnOutliers <- list()
glbObsTrnOutliers[["Final"]] <- union(glbObsFitOutliers[["All.X"]],
                                c(NULL
                                ))

# Modify mdlId to (build & extract) "<FamilyId>#<Fit|Trn>#<caretMethod>#<preProc1.preProc2>#<samplingMethod>"
glb_models_lst <- list(); glb_models_df <- data.frame()

# Add xgboost algorithm

# Regression
if (glb_is_regression) {
    glbMdlMethods <- c(NULL
        # deterministic
            #, "lm", # same as glm
            , "glm", "bayesglm", "glmnet"
            , "rpart"
        # non-deterministic
            , "gbm", "rf" 
        # Unknown
            , "nnet" , "avNNet" # runs 25 models per cv sample for tunelength=5
            , "svmLinear", "svmLinear2"
            , "svmPoly" # runs 75 models per cv sample for tunelength=5
            , "svmRadial" 
            , "earth"
            , "bagEarth" # Takes a long time
            ,"xgbLinear","xgbTree"
        )
} else
# Classification - Add ada (auto feature selection)
    if (glb_is_binomial)
        glbMdlMethods <- c(NULL
        # deterministic                     
            , "bagEarth" # Takes a long time        
            , "glm", "bayesglm", "glmnet"
            , "nnet"
            , "rpart"
        # non-deterministic        
            , "gbm"
            , "avNNet" # runs 25 models per cv sample for tunelength=5      
            , "rf"
        # Unknown
            , "lda", "lda2"
                # svm models crash when predict is called -> internal to kernlab it should call predict without .outcome
            , "svmLinear", "svmLinear2"
            , "svmPoly" # runs 75 models per cv sample for tunelength=5
            , "svmRadial" 
            , "earth"
            ,"xgbLinear","xgbTree"
        ) else
        glbMdlMethods <- c(NULL
        # deterministic
            ,"glmnet"
        # non-deterministic 
            ,"rf"       
        # Unknown
            ,"gbm","rpart","xgbLinear","xgbTree"
        )

glbMdlFamilies <- list(); glb_mdl_feats_lst <- list()
# family: Choose from c("RFE.X", "Csm.X", "All.X", "Best.Interact") %*% c(NUll, ".NOr", ".Inc")
#   RFE = "Recursive Feature Elimination"
#   Csm = CuStoM
#   NOr = No OutlieRs
#   Inc = INteraCt
#   methods: Choose from c(NULL, <method>, glbMdlMethods) 
#glbMdlFamilies[["RFE.X"]] <- c("glmnet", "glm") # non-NULL vector is mandatory
if (glb_is_classification && !glb_is_binomial) {
    # glm does not work for multinomial
    glbMdlFamilies[["All.X"]] <- c("glmnet") 
} else {
    # glbMdlFamilies[["All.X"]] <- c("glmnet", "glm")
    glbMdlFamilies[["All.X"]] <- c("glmnet")    
    # glbMdlFamilies[["RFE.X"]] <- c("glmnet", "glm")
    # glbMdlFamilies[["RFE.X"]] <- setdiff(glbMdlMethods, c(NULL
    #     , "bayesglm" # error: Error in trControl$classProbs && any(classLevels != make.names(classLevels)) : invalid 'x' type in 'x && y'
    #     , "lda","lda2" # error: Error in lda.default(x, grouping, ...) : variable 236 appears to be constant within groups
    #     , "svmLinear" # Error in .local(object, ...) : test vector does not match model ! In addition: Warning messages:
    #     , "svmLinear2" # SVM has not been trained using `probability = TRUE`, probabilities not available for predictions
    #     , "svmPoly" # runs 75 models per cv sample for tunelength=5 # took > 2 hrs # Error in .local(object, ...) : test vector does not match model !     
    #     , "svmRadial" # didn't bother
    #     ,"xgbLinear","xgbTree" # Need clang-omp compiler; Upgrade to Revolution R 3.2.3 (3.2.2 current); https://github.com/dmlc/xgboost/issues/276 thread
    #                                     ))
}
# glbMdlFamilies[["All.X.Inc"]] <- glbMdlFamilies[["All.X"]] # value not used
# glbMdlFamilies[["RFE.X.Inc"]] <- glbMdlFamilies[["RFE.X"]] # value not used

# Check if interaction features make RFE better
# glbMdlFamilies[["CSM.X"]] <- setdiff(glbMdlMethods, c("lda", "lda2")) # crashing due to category:.clusterid ??? #c("glmnet", "glm") # non-NULL list is mandatory
# glb_mdl_feats_lst[["CSM.X"]] <- c(NULL
#     , <comma-separated-features-vector>
#                                   )
# dAFeats.CSM.X %<d-% c(NULL
#     # Interaction feats up to varImp(RFE.X.glmnet) >= 50
#     , <comma-separated-features-vector>
#     , setdiff(myextract_actual_feats(predictors(glbRFEResults)), c(NULL
#                , <comma-separated-features-vector>
#                                                                       ))    
#                                   )
# glb_mdl_feats_lst[["CSM.X"]] <- "%<d-% dAFeats.CSM.X"

# glbMdlFamilies[["Final"]] <- c(NULL) # NULL vector acceptable # c("glmnet", "glm")

glbMdlAllowParallel <- list()
#glbMdlAllowParallel[["Final##rcv#glmnet"]] <- FALSE
glbMdlAllowParallel[["All.X##rcv#glm"]] <- FALSE
glbMdlAllowParallel[["All.X#ica#rcv#glmnet"]] <- FALSE
glbMdlAllowParallel[["All.X#zv.pca#rcv#glmnet"]] <- FALSE

# Check if tuning parameters make fit better; make it mdlFamily customizable ?
glbMdlTuneParams <- data.frame()
# When glmnet crashes at model$grid with error: ???
AllX__rcv_glmnetTuneParams <- rbind(data.frame()
    ,data.frame(parameter = "alpha",  vals = "0.100 0.325 0.550 0.775 1.000")
    ,data.frame(parameter = "lambda", vals = "0.0356818417 0.05 0.06367626 0.07 0.09167068")
                        )
AllX_expoTransspatialSign_rcv_glmnetTuneParams <- rbind(data.frame()
    ,data.frame(parameter = "alpha",  vals = "0.100 0.325 0.550 0.775 1.000")
    ,data.frame(parameter = "lambda", vals = "0.0072065998 0.02 0.0334500732 0.04 0.05969355")
                        ) # max.Accuracy.OOB = 0.5956175 @ 0.325 0.03345007
FinalAllX__rcv_glmnetTuneParams <- rbind(data.frame()
    ,data.frame(parameter = "alpha",  vals = "0.100 0.325 0.550 0.775 1.000")
    ,data.frame(parameter = "lambda", vals = "6.451187e-03 0.02 2.994376e-02 0.04 0.05343633")
                        )
FinalAllX_expoTransspatialSign_rcv_glmnetTuneParams <- rbind(data.frame()
    ,data.frame(parameter = "alpha",  vals = "0.100 0.325 0.550 0.775 1.000")
    ,data.frame(parameter = "lambda", vals = "6.487621e-03 0.02 3.011287e-02 0.04 0.05373812")
                        ) # max.Accuracy.fit = 0.5991618 @ 0.55 0.03011287
glbMdlTuneParams <- rbind(glbMdlTuneParams,
    cbind(data.frame(mdlId = "All.X##rcv#glmnet"),            AllX__rcv_glmnetTuneParams),
    cbind(data.frame(mdlId = "All.X#expoTrans.spatialSign#rcv#glmnet"),
                                AllX_expoTransspatialSign_rcv_glmnetTuneParams),    
    cbind(data.frame(mdlId = "Final.All.X##rcv#glmnet"), FinalAllX__rcv_glmnetTuneParams),
    cbind(data.frame(mdlId = "Final.All.X#expoTrans.spatialSign#rcv#glmnet"),
                                FinalAllX_expoTransspatialSign_rcv_glmnetTuneParams))

    #avNNet    
    #   size=[1] 3 5 7 9; decay=[0] 1e-04 0.001  0.01   0.1; bag=[FALSE]; RMSE=1.3300906 

    #bagEarth
    #   degree=1 [2] 3; nprune=64 128 256 512 [1024]; RMSE=0.6486663 (up)
bagEarthTuneParams <- rbind(data.frame()
                        ,data.frame(parameter = "degree", vals = "1")
                        ,data.frame(parameter = "nprune", vals = "256")
                        )
# glbMdlTuneParams <- myrbind_df(glbMdlTuneParams,
#                                cbind(data.frame(mdlId = "Final.RFE.X.Inc##rcv#bagEarth"),
#                                      bagEarthTuneParams))

# glbMdlTuneParams <- myrbind_df(glbMdlTuneParams, rbind(data.frame()
#     ,data.frame(method = "bagEarth", parameter = "nprune", vals = "256")
#     ,data.frame(method = "bagEarth", parameter = "degree", vals = "2")    
# ))

    #earth 
    #   degree=[1]; nprune=2  [9] 17 25 33; RMSE=0.1334478
    
    #gbm 
    #   shrinkage=0.05 [0.10] 0.15 0.20 0.25; n.trees=100 150 200 [250] 300; interaction.depth=[1] 2 3 4 5; n.minobsinnode=[10]; RMSE=0.2008313     
# glbMdlTuneParams <- myrbind_df(glbMdlTuneParams, rbind(data.frame()
#     ,data.frame(method = "gbm", parameter = "shrinkage", min = 0.05, max = 0.25, by = 0.05)
#     ,data.frame(method = "gbm", parameter = "n.trees", min = 100, max = 300, by = 50)
#     ,data.frame(method = "gbm", parameter = "interaction.depth", min = 1, max = 5, by = 1)
#     ,data.frame(method = "gbm", parameter = "n.minobsinnode", min = 10, max = 10, by = 10)
#     #seq(from=0.05,  to=0.25, by=0.05)
# ))

    #glmnet
    #   alpha=0.100 [0.325] 0.550 0.775 1.000; lambda=0.0005232693 0.0024288010 0.0112734954 [0.0523269304] 0.2428800957; RMSE=0.6164891
# glbMdlTuneParams <- myrbind_df(glbMdlTuneParams, rbind(data.frame()
#     ,data.frame(method = "glmnet", parameter = "alpha", vals = "0.550 0.775 0.8875 0.94375 1.000")
#     ,data.frame(method = "glmnet", parameter = "lambda", vals = "9.858855e-05 0.0001971771 0.0009152152 0.0042480525 0.0197177130")    
# ))

    #nnet    
    #   size=3 5 [7] 9 11; decay=0.0001 0.001 0.01 [0.1] 0.2; RMSE=0.9287422
# glbMdlTuneParams <- myrbind_df(glbMdlTuneParams, rbind(data.frame()
#     ,data.frame(method = "nnet", parameter = "size", vals = "3 5 7 9 11")
#     ,data.frame(method = "nnet", parameter = "decay", vals = "0.0001 0.0010 0.0100 0.1000 0.2000")    
# ))

    #rf # Don't bother; results are not deterministic
    #       mtry=2  35  68 [101] 134; RMSE=0.1339974
# glbMdlTuneParams <- myrbind_df(glbMdlTuneParams, rbind(data.frame()
#     ,data.frame(method = "rf", parameter = "mtry", vals = "2 5 9 13 17")
# ))

    #rpart 
    #   cp=0.020 [0.025] 0.030 0.035 0.040; RMSE=0.1770237
# glbMdlTuneParams <- myrbind_df(glbMdlTuneParams, rbind(data.frame()    
#     ,data.frame(method = "rpart", parameter = "cp", vals = "0.004347826 0.008695652 0.017391304 0.021739130 0.034782609")
# ))
    
    #svmLinear
    #   C=0.01 0.05 [0.10] 0.50 1.00 2.00 3.00 4.00; RMSE=0.1271318; 0.1296718
# glbMdlTuneParams <- myrbind_df(glbMdlTuneParams, rbind(data.frame()
#     ,data.frame(method = "svmLinear", parameter = "C", vals = "0.01 0.05 0.1 0.5 1")
# ))

    #svmLinear2    
    #   cost=0.0625 0.1250 [0.25] 0.50 1.00; RMSE=0.1276354 
# glbMdlTuneParams <- myrbind_df(glbMdlTuneParams, rbind(data.frame()
#     ,data.frame(method = "svmLinear2", parameter = "cost", vals = "0.0625 0.125 0.25 0.5 1")
# ))

    #svmPoly    
    #   degree=[1] 2 3 4 5; scale=0.01 0.05 [0.1] 0.5 1; C=0.50 1.00 [2.00] 3.00 4.00; RMSE=0.1276130
# glbMdlTuneParams <- myrbind_df(glbMdlTuneParams, rbind(data.frame()
#     ,data.frame(method="svmPoly", parameter="degree", min=1, max=5, by=1) #seq(1, 5, 1)
#     ,data.frame(method="svmPoly", parameter="scale", vals="0.01, 0.05, 0.1, 0.5, 1")
#     ,data.frame(method="svmPoly", parameter="C", vals="0.50, 1.00, 2.00, 3.00, 4.00")    
# ))

    #svmRadial
    #   sigma=[0.08674323]; C=0.25 0.50 1.00 [2.00] 4.00; RMSE=0.1614957
    
#glb2Sav(); all.equal(sav_models_df, glb_models_df)

pkgPreprocMethods <-     
# caret version: 6.0.068 # packageVersion("caret")
# operations are applied in this order: zero-variance filter, near-zero variance filter, Box-Cox/Yeo-Johnson/exponential transformation, centering, scaling, range, imputation, PCA, ICA then spatial sign
# *Impute methods needed only if NAs are fed to myfit_mdl
#   Also, ordered.factor in caret creates features as Edn.fctr^4 which is treated as an exponent by bagImpute
    c(NULL
      ,"zv", "nzv"
      ,"BoxCox", "YeoJohnson", "expoTrans"
      ,"center", "scale", "center.scale", "range"
      ,"knnImpute", "bagImpute", "medianImpute"
      ,"zv.pca", "ica", "spatialSign"
      ,"conditionalX") 

glbMdlPreprocMethods <- list(# NULL # : default
    "All.X" = list("glmnet" = union(setdiff(pkgPreprocMethods,
                                            c("knnImpute", "bagImpute", "medianImpute")),
                                    # c(NULL)))
                                    c("expoTrans.spatialSign")))
)
# glbMdlPreprocMethods[["RFE.X"]] <- list("glmnet" = union(unlist(glbMdlPreprocMethods[["All.X"]]),
#                                                     "nzv.pca.spatialSign"))

# Baseline prediction model feature(s)
glb_Baseline_mdl_var <- NULL # or c("<feat>")

glbMdlMetric_terms <- NULL # or matrix(c(
#                               0,1,2,3,4,
#                               2,0,1,2,3,
#                               4,2,0,1,2,
#                               6,4,2,0,1,
#                               8,6,4,2,0
#                           ), byrow=TRUE, nrow=5)
glbMdlMetricSummary <- NULL # or "<metric_name>"
glbMdlMetricMaximize <- NULL # or FALSE (TRUE is not the default for both classification & regression) 
glbMdlMetricSummaryFn <- NULL # or function(data, lev=NULL, model=NULL) {
#     confusion_mtrx <- t(as.matrix(confusionMatrix(data$pred, data$obs)))
#     #print(confusion_mtrx)
#     #print(confusion_mtrx * glbMdlMetric_terms)
#     metric <- sum(confusion_mtrx * glbMdlMetric_terms) / nrow(data)
#     names(metric) <- glbMdlMetricSummary
#     return(metric)
# }

glbMdlCheckRcv <- FALSE # Turn it on when needed; otherwise takes long time
glb_rcv_n_folds <- 3 # or NULL
glb_rcv_n_repeats <- 3 # or NULL

glb_clf_proba_threshold <- NULL # 0.5

# Model selection criteria
if (glb_is_regression)
    glbMdlMetricsEval <- c("min.RMSE.OOB", "max.R.sq.OOB", "min.elapsedtime.everything",
                           "max.Adj.R.sq.fit", "min.RMSE.fit")
    #glbMdlMetricsEval <- c("min.RMSE.fit", "max.R.sq.fit", "max.Adj.R.sq.fit")    
if (glb_is_classification) {
    if (glb_is_binomial)
        glbMdlMetricsEval <- 
            c("max.Accuracy.OOB", "max.AUCROCR.OOB", "max.AUCpROC.OOB",
              "min.elapsedtime.everything", 
              # "min.aic.fit", 
              "max.Accuracy.fit") else        
        glbMdlMetricsEval <- c("max.Accuracy.OOB", "max.Kappa.OOB", "min.elapsedtime.everything")
}

# select from NULL [no ensemble models], "auto" [all models better than MFO or Baseline], c(mdl_ids in glb_models_lst) [Typically top-rated models in auto]
glbMdlEnsemble <- NULL #"auto"
#     "%<d-% setdiff(mygetEnsembleAutoMdlIds(), 'CSM.X.rf')" 
#     c(<comma-separated-mdlIds>
#      )

# Only for classifications; for regressions remove "(.*)\\.prob" form the regex
# tmp_fitobs_df <- glbObsFit[, grep(paste0("^", gsub(".", "\\.", mygetPredictIds$value, fixed = TRUE), "CSM\\.X\\.(.*)\\.prob"), names(glbObsFit), value = TRUE)]; cor_mtrx <- cor(tmp_fitobs_df); cor_vctr <- sort(cor_mtrx[row.names(orderBy(~-Overall, varImp(glb_models_lst[["Ensemble.repeatedcv.glmnet"]])$imp))[1], ]); summary(cor_vctr); cor_vctr
#ntv.glm <- glm(reformulate(indepVar, glb_rsp_var), family = "binomial", data = glbObsFit)
#step.glm <- step(ntv.glm)

glbMdlSelId <- NULL #select from c(NULL, "All.X##rcv#glmnet", "RFE.X##rcv#glmnet", <mdlId>)
glbMdlFinId <- NULL #select from c(NULL, glbMdlSelId)

glb_dsp_cols <- c(".pos", glbFeatsId, glbFeatsCategory, glb_rsp_var
#               List critical cols excl. above
                  )

# Output specs
# lclgetfltout_df <- function(obsOutFinDf) {
#     require(tidyr)
#     obsOutFinDf <- obsOutFinDf %>%
#         tidyr::separate("ImageId.x.y", c(".src", ".pos", "x", "y"), 
#                         sep = "#", remove = TRUE, extra = "merge")
#     # mnm prefix stands for max_n_mean
#     mnmout_df <- obsOutFinDf %>%
#         dplyr::group_by(.pos) %>%
#         #dplyr::top_n(1, Probability1) %>% # Score = 3.9426         
#         #dplyr::top_n(2, Probability1) %>% # Score = ???; weighted = 3.94254;         
#         #dplyr::top_n(3, Probability1) %>% # Score = 3.9418; weighted = 3.94169; 
#         dplyr::top_n(4, Probability1) %>% # Score = ???; weighted = 3.94149;        
#         #dplyr::top_n(5, Probability1) %>% # Score = 3.9421; weighted = 3.94178
#     
#         # dplyr::summarize(xMeanN = mean(as.numeric(x)), yMeanN = mean(as.numeric(y)))
#         # dplyr::summarize(xMeanN = weighted.mean(as.numeric(x), Probability1), yMeanN = mean(as.numeric(y)))
#         # dplyr::summarize(xMeanN = weighted.mean(as.numeric(x), c(Probability1, 0.2357323, 0.2336925)), yMeanN = mean(as.numeric(y)))    
#         # dplyr::summarize(xMeanN = weighted.mean(as.numeric(x), c(Probability1)), yMeanN = mean(as.numeric(y)))
#         dplyr::summarize(xMeanN = weighted.mean(as.numeric(x), c(Probability1)), 
#                          yMeanN = weighted.mean(as.numeric(y), c(Probability1)))  
#     
#     maxout_df <- obsOutFinDf %>%
#         dplyr::group_by(.pos) %>%
#         dplyr::summarize(maxProb1 = max(Probability1))
#     fltout_df <- merge(maxout_df, obsOutFinDf, 
#                        by.x = c(".pos", "maxProb1"), by.y = c(".pos", "Probability1"),
#                        all.x = TRUE)
#     fmnout_df <- merge(fltout_df, mnmout_df, 
#                        by.x = c(".pos"), by.y = c(".pos"),
#                        all.x = TRUE)
#     return(fmnout_df)
# }
glbObsOut <- list(NULL
        # glbFeatsId will be the first output column, by default
        ,vars = list()
#         ,mapFn = function(obsOutFinDf) {
#                   }
                  )
#obsOutFinDf <- savobsOutFinDf
# glbObsOut$mapFn <- function(obsOutFinDf) {
#     txfout_df <- dplyr::select(obsOutFinDf, -.pos.y) %>%
#         dplyr::mutate(
#             lunch     = levels(glbObsTrn[, "lunch"    ])[
#                        round(mean(as.numeric(glbObsTrn[, "lunch"    ])), 0)],
#             dinner    = levels(glbObsTrn[, "dinner"   ])[
#                        round(mean(as.numeric(glbObsTrn[, "dinner"   ])), 0)],
#             reserve   = levels(glbObsTrn[, "reserve"  ])[
#                        round(mean(as.numeric(glbObsTrn[, "reserve"  ])), 0)],
#             outdoor   = levels(glbObsTrn[, "outdoor"  ])[
#                        round(mean(as.numeric(glbObsTrn[, "outdoor"  ])), 0)],
#             expensive = levels(glbObsTrn[, "expensive"])[
#                        round(mean(as.numeric(glbObsTrn[, "expensive"])), 0)],
#             liquor    = levels(glbObsTrn[, "liquor"   ])[
#                        round(mean(as.numeric(glbObsTrn[, "liquor"   ])), 0)],
#             table     = levels(glbObsTrn[, "table"    ])[
#                        round(mean(as.numeric(glbObsTrn[, "table"    ])), 0)],
#             classy    = levels(glbObsTrn[, "classy"   ])[
#                        round(mean(as.numeric(glbObsTrn[, "classy"   ])), 0)],
#             kids      = levels(glbObsTrn[, "kids"     ])[
#                        round(mean(as.numeric(glbObsTrn[, "kids"     ])), 0)]
#                       )
#     
#     print("ObsNew output class tables:")
#     print(sapply(c("lunch","dinner","reserve","outdoor",
#                    "expensive","liquor","table",
#                    "classy","kids"), 
#                  function(feat) table(txfout_df[, feat], useNA = "ifany")))
#     
#     txfout_df <- txfout_df %>%
#         dplyr::mutate(labels = "") %>%
#         dplyr::mutate(labels = 
#     ifelse(lunch     != "-1", paste(labels, lunch    ), labels)) %>%
#         dplyr::mutate(labels = 
#     ifelse(dinner    != "-1", paste(labels, dinner   ), labels)) %>%
#         dplyr::mutate(labels = 
#     ifelse(reserve   != "-1", paste(labels, reserve  ), labels)) %>%
#         dplyr::mutate(labels = 
#     ifelse(outdoor   != "-1", paste(labels, outdoor  ), labels)) %>%
#         dplyr::mutate(labels =         
#     ifelse(expensive != "-1", paste(labels, expensive), labels)) %>%
#         dplyr::mutate(labels =         
#     ifelse(liquor    != "-1", paste(labels, liquor   ), labels)) %>%
#         dplyr::mutate(labels =         
#     ifelse(table     != "-1", paste(labels, table    ), labels)) %>%
#         dplyr::mutate(labels =         
#     ifelse(classy    != "-1", paste(labels, classy   ), labels)) %>%
#         dplyr::mutate(labels =         
#     ifelse(kids      != "-1", paste(labels, kids     ), labels)) %>%
#         dplyr::select(business_id, labels)
#     return(txfout_df)
# }
#if (!is.null(glbObsOut$mapFn)) obsOutFinDf <- glbObsOut$mapFn(obsOutFinDf); print(head(obsOutFinDf))

glb_out_obs <- NULL # select from c(NULL : default to "new", "all", "new", "trn")

if (glb_is_classification && glb_is_binomial) {
    # glbObsOut$vars[["Probability1"]] <- 
    #     "%<d-% glbObsNew[, mygetPredictIds(glb_rsp_var, glbMdlFinId)$prob]" 
    # glbObsOut$vars[[glb_rsp_var_raw]] <-
    #     "%<d-% glb_map_rsp_var_to_raw(glbObsNew[,
    #                                         mygetPredictIds(glb_rsp_var, glbMdlFinId)$value])"
    glbObsOut$vars[["Predictions"]] <-
        "%<d-% glb_map_rsp_var_to_raw(glbObsNew[,
                                            mygetPredictIds(glb_rsp_var, glbMdlFinId)$value])"
} else {
#     glbObsOut$vars[[glbFeatsId]] <- 
#         "%<d-% as.integer(gsub('Test#', '', glbObsNew[, glbFeatsId]))"
    glbObsOut$vars[[glb_rsp_var]] <- 
        "%<d-% glbObsNew[, mygetPredictIds(glb_rsp_var, glbMdlFinId)$value]"
#     for (outVar in setdiff(glbFeatsExcludeLcl, glb_rsp_var_raw))
#         glbObsOut$vars[[outVar]] <- 
#             paste0("%<d-% mean(glbObsAll[, \"", outVar, "\"], na.rm = TRUE)")
}    
# glbObsOut$vars[[glb_rsp_var_raw]] <- glb_rsp_var_raw
# glbObsOut$vars[[paste0(head(unlist(strsplit(mygetPredictIds$value, "")), -1), collapse = "")]] <-

glbOutStackFnames <- # NULL #: default
    c("Votes_Ensemble_cnk06_out_fin.csv") # manual stack
    # c("ebayipads_finmdl_bid1_out_nnet_1.csv") # universal stack

glbOut <- list(pfx = "Q109244No_AllXpreProc_cnk02_rest_")
# lclImageSampleSeed <- 129
glbOutDataVizFname <- NULL # choose from c(NULL, "<projectId>_obsall.csv")


glbChunks <- list(labels = c("set_global_options_wd","set_global_options"
    ,"import.data","inspect.data","scrub.data","transform.data"
    ,"extract.features"
        ,"extract.features.datetime","extract.features.image","extract.features.price"
        ,"extract.features.text","extract.features.string"  
        ,"extract.features.end"
    ,"manage.missing.data","cluster.data","partition.data.training","select.features"
    ,"fit.models_0","fit.models_1","fit.models_2","fit.models_3"
    ,"fit.data.training_0","fit.data.training_1"
    ,"predict.data.new"         
    ,"display.session.info"))
# To ensure that all chunks in this script are in glbChunks
if (!is.null(chkChunksLabels <- knitr::all_labels()) && # knitr::all_labels() doesn't work in console runs
    !identical(chkChunksLabels, glbChunks$labels)) {
    print(sprintf("setdiff(chkChunksLabels, glbChunks$labels): %s", 
                  setdiff(chkChunksLabels, glbChunks$labels)))    
    print(sprintf("setdiff(glbChunks$labels, chkChunksLabels): %s", 
                  setdiff(glbChunks$labels, chkChunksLabels)))    
}

glbChunks[["first"]] <- "fit.models_1" # NULL # default: script will load envir from previous chunk
glbChunks[["last" ]] <- NULL # NULL # default: script will save envir at end of this chunk 
glbChunks[["inpFilePathName"]] <- "data/Q109244No_AllXpreProc_cnk02_fit.models_1_fit.models_1.RData" # NULL: default or "data/<prvScriptName>_<lstChunkLbl>.RData"
#mysavChunk(glbOut$pfx, glbChunks[["last"]]) # called from myevlChunk
# Temporary: Delete this function (if any) from here after appropriate .RData file is saved

# Inspect max OOB FP
#chkObsOOB <- subset(glbObsOOB, !label.fctr.All.X..rcv.glmnet.is.acc)
#chkObsOOBFP <- subset(chkObsOOB, label.fctr.All.X..rcv.glmnet == "left_eye_center") %>% dplyr::mutate(Probability1 = label.fctr.All.X..rcv.glmnet.prob) %>% select(-.src, -.pos, -x, -y) %>% lclgetfltout_df() %>% mutate(obj.distance = (((as.numeric(x) - left_eye_center_x.int) ^ 2) + ((as.numeric(y) - left_eye_center_y.int) ^ 2)) ^ 0.5) %>% dplyr::top_n(5, obj.distance) %>% dplyr::top_n(5, -patch.cor)
#
#newImgObs <- glbObsNew[(glbObsNew$ImageId == "Test#0001"), ]; print(newImgObs[which.max(newImgObs$label.fctr.Final..rcv.glmnet.prob), ])
#OOBImgObs <- glbObsOOB[(glbObsOOB$ImageId == "Train#0003"), ]; print(OOBImgObs[which.max(OOBImgObs$label.fctr.All.X..rcv.glmnet.prob), ])

#mygetImage(which(glbObsAll[, glbFeatsId] == "Train#0003"), names(glbFeatsImage)[1], plot = TRUE, featHighlight = c("left_eye_center_x", "left_eye_center_y"), ovrlHighlight = c(66, 35))

# Depict process
glb_analytics_pn <- petrinet(name = "glb_analytics_pn",
                        trans_df = data.frame(id = 1:6,
    name = c("data.training.all","data.new",
           "model.selected","model.final",
           "data.training.all.prediction","data.new.prediction"),
    x=c(   -5,-5,-15,-25,-25,-35),
    y=c(   -5, 5,  0,  0, -5,  5)
                        ),
                        places_df=data.frame(id=1:4,
    name=c("bgn","fit.data.training.all","predict.data.new","end"),
    x=c(   -0,   -20,                    -30,               -40),
    y=c(    0,     0,                      0,                 0),
    M0=c(   3,     0,                      0,                 0)
                        ),
                        arcs_df = data.frame(
    begin = c("bgn","bgn","bgn",        
            "data.training.all","model.selected","fit.data.training.all",
            "fit.data.training.all","model.final",    
            "data.new","predict.data.new",
            "data.training.all.prediction","data.new.prediction"),
    end   = c("data.training.all","data.new","model.selected",
            "fit.data.training.all","fit.data.training.all","model.final",
            "data.training.all.prediction","predict.data.new",
            "predict.data.new","data.new.prediction",
            "end","end")
                        ))
#print(ggplot.petrinet(glb_analytics_pn))
print(ggplot.petrinet(glb_analytics_pn) + coord_flip())
## Loading required package: grid

glb_analytics_avl_objs <- NULL

glb_chunks_df <- myadd_chunk(NULL, 
                             ifelse(is.null(glbChunks$first), "import.data", glbChunks$first))
##          label step_major step_minor label_minor   bgn end elapsed
## 1 fit.models_1          1          0           0 9.967  NA      NA

Step 1.0: fit models_1

chunk option: eval=

Step 1.0: fit models_1

Step 1.0: fit models_1

```{r scrub.data, cache=FALSE, echo=FALSE, eval=myevlChunk(glbChunks, glbOut$pfx)}

Step 1.0: fit models_1

Step 1.0: fit models_1

Step 1.0: fit models_1

Step 1.0: fit models_1

```{r extract.features.image, cache=FALSE, echo=FALSE, fig.height=5, fig.width=5, eval=myevlChunk(glbChunks, glbOut$pfx)}

Step 1.0: fit models_1

Step 1.0: fit models_1

Step 1.0: fit models_1

Step 1.0: fit models_1

Step 1.0: fit models_1

Step 1.0: fit models_1

```{r cluster.data, cache=FALSE, echo=FALSE, eval=myevlChunk(glbChunks, glbOut$pfx)}

Step 1.0: fit models_1

Step 1.0: fit models_1

```{r select.features, cache=FALSE, echo=FALSE, eval=myevlChunk(glbChunks, glbOut$pfx)}

Step 1.0: fit models_1

fit.models_0_chunk_df <- myadd_chunk(NULL, "fit.models_0_bgn", label.minor = "setup")
# load(paste0(glbOut$pfx, "dsk.RData"))

glbgetModelSelectFormula <- function() {
    model_evl_terms <- c(NULL)
    # min.aic.fit might not be avl
    lclMdlEvlCriteria <- 
        glbMdlMetricsEval[glbMdlMetricsEval %in% names(glb_models_df)]
    for (metric in lclMdlEvlCriteria)
        model_evl_terms <- c(model_evl_terms, 
                             ifelse(length(grep("max", metric)) > 0, "-", "+"), metric)
    if (glb_is_classification && glb_is_binomial)
        model_evl_terms <- c(model_evl_terms, "-", "opt.prob.threshold.OOB")
    model_sel_frmla <- as.formula(paste(c("~ ", model_evl_terms), collapse = " "))
    return(model_sel_frmla)
}

glbgetDisplayModelsDf <- function() {
    dsp_models_cols <- c("id", 
                    glbMdlMetricsEval[glbMdlMetricsEval %in% names(glb_models_df)],
                    grep("opt.", names(glb_models_df), fixed = TRUE, value = TRUE)) 
    dsp_models_df <- 
        #orderBy(glbgetModelSelectFormula(), glb_models_df)[, c("id", glbMdlMetricsEval)]
        orderBy(glbgetModelSelectFormula(), glb_models_df)[, dsp_models_cols]    
    nCvMdl <- sapply(glb_models_lst, function(mdl) nrow(mdl$results))
    nParams <- sapply(glb_models_lst, function(mdl) ifelse(mdl$method == "custom", 0, 
        nrow(subset(modelLookup(mdl$method), parameter != "parameter"))))
    
#     nCvMdl <- nCvMdl[names(nCvMdl) != "avNNet"]
#     nParams <- nParams[names(nParams) != "avNNet"]    
    
    if (length(cvMdlProblems <- nCvMdl[nCvMdl <= nParams]) > 0) {
        print("Cross Validation issues:")
        warning("Cross Validation issues:")        
        print(cvMdlProblems)
    }
    
    pltMdls <- setdiff(names(nCvMdl), names(cvMdlProblems))
    pltMdls <- setdiff(pltMdls, names(nParams[nParams == 0]))
    
    # length(pltMdls) == 21
    png(paste0(glbOut$pfx, "bestTune.png"), width = 480 * 2, height = 480 * 4)
    grid.newpage()
    pushViewport(viewport(layout = grid.layout(ceiling(length(pltMdls) / 2.0), 2)))
    pltIx <- 1
    for (mdlId in pltMdls) {
        print(ggplot(glb_models_lst[[mdlId]], highBestTune = TRUE) + labs(title = mdlId),   
              vp = viewport(layout.pos.row = ceiling(pltIx / 2.0), 
                            layout.pos.col = ((pltIx - 1) %% 2) + 1))  
        pltIx <- pltIx + 1
    }
    dev.off()

    if (all(row.names(dsp_models_df) != dsp_models_df$id))
        row.names(dsp_models_df) <- dsp_models_df$id
    return(dsp_models_df)
}
#glbgetDisplayModelsDf()

glb_get_predictions <- function(df, mdl_id, rsp_var, prob_threshold_def=NULL, verbose=FALSE) {
    mdl <- glb_models_lst[[mdl_id]]
    
    clmnNames <- mygetPredictIds(rsp_var, mdl_id)
    predct_var_name <- clmnNames$value        
    predct_prob_var_name <- clmnNames$prob
    predct_accurate_var_name <- clmnNames$is.acc
    predct_error_var_name <- clmnNames$err
    predct_erabs_var_name <- clmnNames$err.abs

    if (glb_is_regression) {
        df[, predct_var_name] <- predict(mdl, newdata=df, type="raw")
        if (verbose) print(myplot_scatter(df, glb_rsp_var, predct_var_name) + 
                  facet_wrap(reformulate(glbFeatsCategory), scales = "free") + 
                  stat_smooth(method="glm"))

        df[, predct_error_var_name] <- df[, predct_var_name] - df[, glb_rsp_var]
        if (verbose) print(myplot_scatter(df, predct_var_name, predct_error_var_name) + 
                  #facet_wrap(reformulate(glbFeatsCategory), scales = "free") + 
                  stat_smooth(method="auto"))
        if (verbose) print(myplot_scatter(df, glb_rsp_var, predct_error_var_name) + 
                  #facet_wrap(reformulate(glbFeatsCategory), scales = "free") + 
                  stat_smooth(method="glm"))
        
        df[, predct_erabs_var_name] <- abs(df[, predct_error_var_name])
        if (verbose) print(head(orderBy(reformulate(c("-", predct_erabs_var_name)), df)))
        
        df[, predct_accurate_var_name] <- (df[, glb_rsp_var] == df[, predct_var_name])
    }

    if (glb_is_classification && glb_is_binomial) {
        prob_threshold <- glb_models_df[glb_models_df$id == mdl_id, 
                                        "opt.prob.threshold.OOB"]
        if (is.null(prob_threshold) || is.na(prob_threshold)) {
            warning("Using default probability threshold: ", prob_threshold_def)
            if (is.null(prob_threshold <- prob_threshold_def))
                stop("Default probability threshold is NULL")
        }
        
        df[, predct_prob_var_name] <- predict(mdl, newdata = df, type = "prob")[, 2]
        df[, predct_var_name] <- 
                factor(levels(df[, glb_rsp_var])[
                    (df[, predct_prob_var_name] >=
                        prob_threshold) * 1 + 1], levels(df[, glb_rsp_var]))
    
#         if (verbose) print(myplot_scatter(df, glb_rsp_var, predct_var_name) + 
#                   facet_wrap(reformulate(glbFeatsCategory), scales = "free") + 
#                   stat_smooth(method="glm"))

        df[, predct_error_var_name] <- df[, predct_var_name] != df[, glb_rsp_var]
#         if (verbose) print(myplot_scatter(df, predct_var_name, predct_error_var_name) + 
#                   #facet_wrap(reformulate(glbFeatsCategory), scales = "free") + 
#                   stat_smooth(method="auto"))
#         if (verbose) print(myplot_scatter(df, glb_rsp_var, predct_error_var_name) + 
#                   #facet_wrap(reformulate(glbFeatsCategory), scales = "free") + 
#                   stat_smooth(method="glm"))
        
        # if prediction is a TP (true +ve), measure distance from 1.0
        tp <- which((df[, predct_var_name] == df[, glb_rsp_var]) &
                    (df[, predct_var_name] == levels(df[, glb_rsp_var])[2]))
        df[tp, predct_erabs_var_name] <- abs(1 - df[tp, predct_prob_var_name])
        #rowIx <- which.max(df[tp, predct_erabs_var_name]); df[tp, c(glbFeatsId, glb_rsp_var, predct_var_name, predct_prob_var_name, predct_erabs_var_name)][rowIx, ]
        
        # if prediction is a TN (true -ve), measure distance from 0.0
        tn <- which((df[, predct_var_name] == df[, glb_rsp_var]) &
                    (df[, predct_var_name] == levels(df[, glb_rsp_var])[1]))
        df[tn, predct_erabs_var_name] <- abs(0 - df[tn, predct_prob_var_name])
        #rowIx <- which.max(df[tn, predct_erabs_var_name]); df[tn, c(glbFeatsId, glb_rsp_var, predct_var_name, predct_prob_var_name, predct_erabs_var_name)][rowIx, ]
        
        # if prediction is a FP (flse +ve), measure distance from 0.0
        fp <- which((df[, predct_var_name] != df[, glb_rsp_var]) &
                    (df[, predct_var_name] == levels(df[, glb_rsp_var])[2]))
        df[fp, predct_erabs_var_name] <- abs(0 - df[fp, predct_prob_var_name])
        #rowIx <- which.max(df[fp, predct_erabs_var_name]); df[fp, c(glbFeatsId, glb_rsp_var, predct_var_name, predct_prob_var_name, predct_erabs_var_name)][rowIx, ]
        
        # if prediction is a FN (flse -ve), measure distance from 1.0
        fn <- which((df[, predct_var_name] != df[, glb_rsp_var]) &
                    (df[, predct_var_name] == levels(df[, glb_rsp_var])[1]))
        df[fn, predct_erabs_var_name] <- abs(1 - df[fn, predct_prob_var_name])
        #rowIx <- which.max(df[fn, predct_erabs_var_name]); df[fn, c(glbFeatsId, glb_rsp_var, predct_var_name, predct_prob_var_name, predct_erabs_var_name)][rowIx, ]

        
        if (verbose) print(head(orderBy(reformulate(c("-", predct_erabs_var_name)), df)))
        
        df[, predct_accurate_var_name] <- (df[, glb_rsp_var] == df[, predct_var_name])
    }    
    
    if (glb_is_classification && !glb_is_binomial) {
        df[, predct_var_name] <- predict(mdl, newdata = df, type = "raw")
        probCls <- predict(mdl, newdata = df, type = "prob")        
        df[, predct_prob_var_name] <- NA
        for (cls in names(probCls)) {
            mask <- (df[, predct_var_name] == cls)
            df[mask, predct_prob_var_name] <- probCls[mask, cls]
        }    
        if (verbose) print(myplot_histogram(df, predct_prob_var_name, 
                                            fill_col_name = predct_var_name))
        if (verbose) print(myplot_histogram(df, predct_prob_var_name, 
                                            facet_frmla = paste0("~", glb_rsp_var)))
        
        df[, predct_error_var_name] <- df[, predct_var_name] != df[, glb_rsp_var]
        
        # if prediction is erroneous, measure predicted class prob from actual class prob
        df[, predct_erabs_var_name] <- 0
        for (cls in names(probCls)) {
            mask <- (df[, glb_rsp_var] == cls) & (df[, predct_error_var_name])
            df[mask, predct_erabs_var_name] <- probCls[mask, cls]
        }    

        df[, predct_accurate_var_name] <- (df[, glb_rsp_var] == df[, predct_var_name])        
    }

    return(df)
}    

if (glb_is_classification && glb_is_binomial && 
        (length(unique(glbObsFit[, glb_rsp_var])) < 2))
    stop("glbObsFit$", glb_rsp_var, ": contains less than 2 unique values: ",
         paste0(unique(glbObsFit[, glb_rsp_var]), collapse=", "))

max_cor_y_x_vars <- orderBy(~ -cor.y.abs, 
        subset(glb_feats_df, (exclude.as.feat == 0) & !nzv & !is.cor.y.abs.low & 
                                is.na(cor.high.X)))[1:2, "id"]
max_cor_y_x_vars <- max_cor_y_x_vars[!is.na(max_cor_y_x_vars)]
if (length(max_cor_y_x_vars) < 2)
    max_cor_y_x_vars <- union(max_cor_y_x_vars, ".pos")

if (!is.null(glb_Baseline_mdl_var)) {
    if ((max_cor_y_x_vars[1] != glb_Baseline_mdl_var) & 
        (glb_feats_df[glb_feats_df$id == max_cor_y_x_vars[1], "cor.y.abs"] > 
         glb_feats_df[glb_feats_df$id == glb_Baseline_mdl_var, "cor.y.abs"]))
        stop(max_cor_y_x_vars[1], " has a higher correlation with ", glb_rsp_var, 
             " than the Baseline var: ", glb_Baseline_mdl_var)
}

glb_model_type <- ifelse(glb_is_regression, "regression", "classification")
    
# Model specs
# c("id.prefix", "method", "type",
#   # trainControl params
#   "preProc.method", "cv.n.folds", "cv.n.repeats", "summary.fn",
#   # train params
#   "metric", "metric.maximize", "tune.df")

# Baseline
if (!is.null(glb_Baseline_mdl_var)) {
    fit.models_0_chunk_df <- myadd_chunk(fit.models_0_chunk_df, 
                            paste0("fit.models_0_", "Baseline"), major.inc = FALSE,
                                    label.minor = "mybaseln_classfr")
    ret_lst <- myfit_mdl(mdl_id="Baseline", 
                         model_method="mybaseln_classfr",
                        indepVar=glb_Baseline_mdl_var,
                        rsp_var=glb_rsp_var,
                        fit_df=glbObsFit, OOB_df=glbObsOOB)
}    

# Most Frequent Outcome "MFO" model: mean(y) for regression
#   Not using caret's nullModel since model stats not avl
#   Cannot use rpart for multinomial classification since it predicts non-MFO
if (glb_is_classification) {
    fit.models_0_chunk_df <- myadd_chunk(fit.models_0_chunk_df, 
                                paste0("fit.models_0_", "MFO"), major.inc = FALSE,
                                        label.minor = "myMFO_classfr")

    ret_lst <- myfit_mdl(mdl_specs_lst = myinit_mdl_specs_lst(mdl_specs_lst = list(
        id.prefix = "MFO", type = glb_model_type, trainControl.method = "none",
        train.method = ifelse(glb_is_regression, "lm", "myMFO_classfr"))),
                            indepVar = ".rnorm", rsp_var = glb_rsp_var,
                            fit_df = glbObsFit, OOB_df = glbObsOOB)

        # "random" model - only for classification; 
        #   none needed for regression since it is same as MFO
    fit.models_0_chunk_df <- myadd_chunk(fit.models_0_chunk_df, 
                                paste0("fit.models_0_", "Random"), major.inc = FALSE,
                                        label.minor = "myrandom_classfr")

#stop(here"); glb2Sav(); all.equal(glb_models_df, sav_models_df)    
    ret_lst <- myfit_mdl(mdl_specs_lst = myinit_mdl_specs_lst(mdl_specs_lst = list(
        id.prefix = "Random", type = glb_model_type, trainControl.method = "none",
        train.method = "myrandom_classfr")),
                        indepVar = ".rnorm", rsp_var = glb_rsp_var,
                        fit_df = glbObsFit, OOB_df = glbObsOOB)
}

# Max.cor.Y
#   Check impact of cv
#       rpart is not a good candidate since caret does not optimize cp (only tuning parameter of rpart) well
fit.models_0_chunk_df <- myadd_chunk(fit.models_0_chunk_df, 
                        paste0("fit.models_0_", "Max.cor.Y.rcv.*X*"), major.inc = FALSE,
                                    label.minor = "glmnet")

ret_lst <- myfit_mdl(mdl_specs_lst = myinit_mdl_specs_lst(mdl_specs_lst = list(
    id.prefix = "Max.cor.Y.rcv.1X1", type = glb_model_type, trainControl.method = "none",
    train.method = "glmnet")),
                    indepVar = max_cor_y_x_vars, rsp_var = glb_rsp_var, 
                    fit_df = glbObsFit, OOB_df = glbObsOOB)

if (glbMdlCheckRcv) {
    # rcv_n_folds == 1 & rcv_n_repeats > 1 crashes
    for (rcv_n_folds in seq(3, glb_rcv_n_folds + 2, 2))
        for (rcv_n_repeats in seq(1, glb_rcv_n_repeats + 2, 2)) {
            
            # Experiment specific code to avoid caret crash
    #         lcl_tune_models_df <- rbind(data.frame()
    #                             ,data.frame(method = "glmnet", parameter = "alpha", 
    #                                         vals = "0.100 0.325 0.550 0.775 1.000")
    #                             ,data.frame(method = "glmnet", parameter = "lambda",
    #                                         vals = "9.342e-02")    
    #                                     )
            
            ret_lst <- myfit_mdl(mdl_specs_lst = myinit_mdl_specs_lst(mdl_specs_lst =
                list(
                id.prefix = paste0("Max.cor.Y.rcv.", rcv_n_folds, "X", rcv_n_repeats), 
                type = glb_model_type, 
    # tune.df = lcl_tune_models_df,            
                trainControl.method = "repeatedcv",
                trainControl.number = rcv_n_folds, 
                trainControl.repeats = rcv_n_repeats,
                trainControl.classProbs = glb_is_classification,
                trainControl.summaryFunction = glbMdlMetricSummaryFn,
                train.method = "glmnet", train.metric = glbMdlMetricSummary, 
                train.maximize = glbMdlMetricMaximize)),
                                indepVar = max_cor_y_x_vars, rsp_var = glb_rsp_var, 
                                fit_df = glbObsFit, OOB_df = glbObsOOB)
        }
    # Add parallel coordinates graph of glb_models_df[, glbMdlMetricsEval] to evaluate cv parameters
    tmp_models_cols <- c("id", "max.nTuningRuns",
                        glbMdlMetricsEval[glbMdlMetricsEval %in% names(glb_models_df)],
                        grep("opt.", names(glb_models_df), fixed = TRUE, value = TRUE)) 
    print(myplot_parcoord(obs_df = subset(glb_models_df, 
                                          grepl("Max.cor.Y.rcv.", id, fixed = TRUE), 
                                            select = -feats)[, tmp_models_cols],
                          id_var = "id"))
}
        
# Useful for stacking decisions
# fit.models_0_chunk_df <- myadd_chunk(fit.models_0_chunk_df, 
#                     paste0("fit.models_0_", "Max.cor.Y[rcv.1X1.cp.0|]"), major.inc = FALSE,
#                                     label.minor = "rpart")
# 
# ret_lst <- myfit_mdl(mdl_specs_lst = myinit_mdl_specs_lst(mdl_specs_lst = list(
#     id.prefix = "Max.cor.Y.rcv.1X1.cp.0", type = glb_model_type, trainControl.method = "none",
#     train.method = "rpart",
#     tune.df=data.frame(method="rpart", parameter="cp", min=0.0, max=0.0, by=0.1))),
#                     indepVar=max_cor_y_x_vars, rsp_var=glb_rsp_var, 
#                     fit_df=glbObsFit, OOB_df=glbObsOOB)

#stop(here"); glb2Sav(); all.equal(glb_models_df, sav_models_df)
# if (glb_is_regression || glb_is_binomial) # For multinomials this model will be run next by default
ret_lst <- myfit_mdl(mdl_specs_lst = myinit_mdl_specs_lst(mdl_specs_lst = list(
                        id.prefix = "Max.cor.Y", 
                        type = glb_model_type, trainControl.method = "repeatedcv",
                        trainControl.number = glb_rcv_n_folds, 
                        trainControl.repeats = glb_rcv_n_repeats,
                        trainControl.classProbs = glb_is_classification,
                        trainControl.summaryFunction = glbMdlMetricSummaryFn,
                        trainControl.allowParallel = glbMdlAllowParallel,                        
                        train.metric = glbMdlMetricSummary, 
                        train.maximize = glbMdlMetricMaximize,    
                        train.method = "rpart")),
                    indepVar = max_cor_y_x_vars, rsp_var = glb_rsp_var, 
                    fit_df = glbObsFit, OOB_df = glbObsOOB)

if ((length(glbFeatsDateTime) > 0) && 
    (sum(grepl(paste(names(glbFeatsDateTime), "\\.day\\.minutes\\.poly\\.", sep = ""),
               names(glbObsAll))) > 0)) {
    fit.models_0_chunk_df <- myadd_chunk(fit.models_0_chunk_df, 
                    paste0("fit.models_0_", "Max.cor.Y.Time.Poly"), major.inc = FALSE,
                                    label.minor = "glmnet")

    indepVars <- c(max_cor_y_x_vars, 
            grep(paste(names(glbFeatsDateTime), "\\.day\\.minutes\\.poly\\.", sep = ""),
                        names(glbObsAll), value = TRUE))
    indepVars <- myadjustInteractionFeats(glb_feats_df, indepVars)
    ret_lst <- myfit_mdl(mdl_specs_lst = myinit_mdl_specs_lst(mdl_specs_lst = list(
            id.prefix = "Max.cor.Y.Time.Poly", 
            type = glb_model_type, trainControl.method = "repeatedcv",
            trainControl.number = glb_rcv_n_folds, trainControl.repeats = glb_rcv_n_repeats,
            trainControl.classProbs = glb_is_classification,
            trainControl.summaryFunction = glbMdlMetricSummaryFn,
            trainControl.allowParallel = glbMdlAllowParallel,            
            train.metric = glbMdlMetricSummary, 
            train.maximize = glbMdlMetricMaximize,    
            train.method = "glmnet")),
        indepVar = indepVars,
        rsp_var = glb_rsp_var, 
        fit_df = glbObsFit, OOB_df = glbObsOOB)
}

if ((length(glbFeatsDateTime) > 0) && 
    (sum(grepl(paste(names(glbFeatsDateTime), "\\.last[[:digit:]]", sep = ""),
               names(glbObsAll))) > 0)) {
    fit.models_0_chunk_df <- myadd_chunk(fit.models_0_chunk_df, 
                    paste0("fit.models_0_", "Max.cor.Y.Time.Lag"), major.inc = FALSE,
                                    label.minor = "glmnet")

    indepVars <- c(max_cor_y_x_vars, 
            grep(paste(names(glbFeatsDateTime), "\\.last[[:digit:]]", sep = ""),
                        names(glbObsAll), value = TRUE))
    indepVars <- myadjustInteractionFeats(glb_feats_df, indepVars)
    ret_lst <- myfit_mdl(mdl_specs_lst = myinit_mdl_specs_lst(mdl_specs_lst = list(
        id.prefix = "Max.cor.Y.Time.Lag", 
        type = glb_model_type, 
        tune.df = glbMdlTuneParams,        
        trainControl.method = "repeatedcv",
        trainControl.number = glb_rcv_n_folds, trainControl.repeats = glb_rcv_n_repeats,
        trainControl.classProbs = glb_is_classification,
        trainControl.summaryFunction = glbMdlMetricSummaryFn,
        trainControl.allowParallel = glbMdlAllowParallel,        
        train.metric = glbMdlMetricSummary, 
        train.maximize = glbMdlMetricMaximize,    
        train.method = "glmnet")),
        indepVar = indepVars,
        rsp_var = glb_rsp_var, 
        fit_df = glbObsFit, OOB_df = glbObsOOB)
}

if (length(glbFeatsText) > 0) {
    fit.models_0_chunk_df <- myadd_chunk(fit.models_0_chunk_df, 
                    paste0("fit.models_0_", "Txt.*"), major.inc = FALSE,
                                    label.minor = "glmnet")

    indepVars <- c(max_cor_y_x_vars)
    for (txtFeat in names(glbFeatsText))
        indepVars <- union(indepVars, 
            grep(paste(str_to_upper(substr(txtFeat, 1, 1)), "\\.(?!([T|P]\\.))", sep = ""),
                        names(glbObsAll), perl = TRUE, value = TRUE))
    indepVars <- myadjustInteractionFeats(glb_feats_df, indepVars)
    ret_lst <- myfit_mdl(mdl_specs_lst = myinit_mdl_specs_lst(mdl_specs_lst = list(
        id.prefix = "Max.cor.Y.Text.nonTP", 
        type = glb_model_type, 
        tune.df = glbMdlTuneParams,        
        trainControl.method = "repeatedcv",
        trainControl.number = glb_rcv_n_folds, trainControl.repeats = glb_rcv_n_repeats,
        trainControl.classProbs = glb_is_classification,
        trainControl.summaryFunction = glbMdlMetricSummaryFn,
        trainControl.allowParallel = glbMdlAllowParallel,                                
        train.metric = glbMdlMetricSummary, 
        train.maximize = glbMdlMetricMaximize,    
        train.method = "glmnet")),
        indepVar = indepVars,
        rsp_var = glb_rsp_var, 
        fit_df = glbObsFit, OOB_df = glbObsOOB)

    indepVars <- c(max_cor_y_x_vars)
    for (txtFeat in names(glbFeatsText))
        indepVars <- union(indepVars, 
            grep(paste(str_to_upper(substr(txtFeat, 1, 1)), "\\.T\\.", sep = ""),
                        names(glbObsAll), perl = TRUE, value = TRUE))
    indepVars <- myadjustInteractionFeats(glb_feats_df, indepVars)
    ret_lst <- myfit_mdl(mdl_specs_lst = myinit_mdl_specs_lst(mdl_specs_lst = list(
        id.prefix = "Max.cor.Y.Text.onlyT", 
        type = glb_model_type, 
        tune.df = glbMdlTuneParams,        
        trainControl.method = "repeatedcv",
        trainControl.number = glb_rcv_n_folds, trainControl.repeats = glb_rcv_n_repeats,
        trainControl.classProbs = glb_is_classification,
        trainControl.summaryFunction = glbMdlMetricSummaryFn,
        train.metric = glbMdlMetricSummary, 
        train.maximize = glbMdlMetricMaximize,    
        train.method = "glmnet")),
        indepVar = indepVars,
        rsp_var = glb_rsp_var, 
        fit_df = glbObsFit, OOB_df = glbObsOOB)

    indepVars <- c(max_cor_y_x_vars)
    for (txtFeat in names(glbFeatsText))
        indepVars <- union(indepVars, 
            grep(paste(str_to_upper(substr(txtFeat, 1, 1)), "\\.P\\.", sep = ""),
                        names(glbObsAll), perl = TRUE, value = TRUE))
    indepVars <- myadjustInteractionFeats(glb_feats_df, indepVars)
    ret_lst <- myfit_mdl(mdl_specs_lst = myinit_mdl_specs_lst(mdl_specs_lst = list(
        id.prefix = "Max.cor.Y.Text.onlyP", 
        type = glb_model_type, 
        tune.df = glbMdlTuneParams,        
        trainControl.method = "repeatedcv",
        trainControl.number = glb_rcv_n_folds, trainControl.repeats = glb_rcv_n_repeats,
        trainControl.classProbs = glb_is_classification,
        trainControl.summaryFunction = glbMdlMetricSummaryFn,
        trainControl.allowParallel = glbMdlAllowParallel,        
        train.metric = glbMdlMetricSummary, 
        train.maximize = glbMdlMetricMaximize,    
        train.method = "glmnet")),
        indepVar = indepVars,
        rsp_var = glb_rsp_var, 
        fit_df = glbObsFit, OOB_df = glbObsOOB)
}

# Interactions.High.cor.Y
if (length(int_feats <- setdiff(setdiff(unique(glb_feats_df$cor.high.X), NA), 
                                subset(glb_feats_df, nzv)$id)) > 0) {
    fit.models_0_chunk_df <- myadd_chunk(fit.models_0_chunk_df, 
                    paste0("fit.models_0_", "Interact.High.cor.Y"), major.inc = FALSE,
                                    label.minor = "glmnet")

    ret_lst <- myfit_mdl(mdl_specs_lst=myinit_mdl_specs_lst(mdl_specs_lst=list(
        id.prefix="Interact.High.cor.Y", 
        type=glb_model_type, trainControl.method="repeatedcv",
        trainControl.number=glb_rcv_n_folds, trainControl.repeats=glb_rcv_n_repeats,
        trainControl.classProbs = glb_is_classification,
        trainControl.summaryFunction = glbMdlMetricSummaryFn,
        trainControl.allowParallel = glbMdlAllowParallel,
        train.metric = glbMdlMetricSummary, 
        train.maximize = glbMdlMetricMaximize,    
        train.method="glmnet")),
        indepVar=c(max_cor_y_x_vars, paste(max_cor_y_x_vars[1], int_feats, sep=":")),
        rsp_var=glb_rsp_var, 
        fit_df=glbObsFit, OOB_df=glbObsOOB)
}    

# Low.cor.X
fit.models_0_chunk_df <- myadd_chunk(fit.models_0_chunk_df, 
                        paste0("fit.models_0_", "Low.cor.X"), major.inc = FALSE,
                                     label.minor = "glmnet")
indepVar <- mygetIndepVar(glb_feats_df)
indepVar <- setdiff(indepVar, unique(glb_feats_df$cor.high.X))
ret_lst <- myfit_mdl(mdl_specs_lst = myinit_mdl_specs_lst(mdl_specs_lst = list(
            id.prefix = "Low.cor.X", 
            type = glb_model_type, 
            tune.df = glbMdlTuneParams,        
            trainControl.method = "repeatedcv",
            trainControl.number = glb_rcv_n_folds, trainControl.repeats = glb_rcv_n_repeats,
            trainControl.classProbs = glb_is_classification,
            trainControl.summaryFunction = glbMdlMetricSummaryFn,
            trainControl.allowParallel = glbMdlAllowParallel,
            train.metric = glbMdlMetricSummary, 
            train.maximize = glbMdlMetricMaximize,    
            train.method = "glmnet")),
        indepVar = indepVar, rsp_var = glb_rsp_var, 
        fit_df = glbObsFit, OOB_df = glbObsOOB)

fit.models_0_chunk_df <- 
    myadd_chunk(fit.models_0_chunk_df, "fit.models_0_end", major.inc = FALSE,
                label.minor = "teardown")

rm(ret_lst)

glb_chunks_df <- myadd_chunk(glb_chunks_df, "fit.models", major.inc = FALSE)

```{r fit.models_1, cache=FALSE, fig.height=10, fig.width=15, eval=myevlChunk(glbChunks, glbOut$pfx)}

##              label step_major step_minor label_minor    bgn end elapsed
## 1 fit.models_1_bgn          1          0       setup 13.244  NA      NA
##                label step_major step_minor label_minor    bgn    end
## 1   fit.models_1_bgn          1          0       setup 13.244 13.253
## 2 fit.models_1_All.X          1          1       setup 13.254     NA
##   elapsed
## 1   0.009
## 2      NA
##                label step_major step_minor label_minor    bgn    end
## 2 fit.models_1_All.X          1          1       setup 13.254 13.259
## 3 fit.models_1_All.X          1          2      glmnet 13.260     NA
##   elapsed
## 2   0.005
## 3      NA
## [1] "skipping fitting model: All.X##rcv#glmnet"
##                  label step_major step_minor label_minor    bgn    end
## 3   fit.models_1_All.X          1          2      glmnet 13.260 13.266
## 4 fit.models_1_preProc          1          3     preProc 13.266     NA
##   elapsed
## 3   0.006
## 4      NA
## Loading required package: gdata
## gdata: read.xls support for 'XLS' (Excel 97-2004) files ENABLED.
## 
## gdata: read.xls support for 'XLSX' (Excel 2007+) files ENABLED.
## 
## Attaching package: 'gdata'
## The following objects are masked from 'package:dplyr':
## 
##     combine, first, last
## The following object is masked from 'package:stats':
## 
##     nobs
## The following object is masked from 'package:utils':
## 
##     object.size
##                                                    id
## All.X##rcv#glmnet                   All.X##rcv#glmnet
## Low.cor.X##rcv#glmnet           Low.cor.X##rcv#glmnet
## Max.cor.Y.rcv.1X1###glmnet Max.cor.Y.rcv.1X1###glmnet
## Max.cor.Y##rcv#rpart             Max.cor.Y##rcv#rpart
## Random###myrandom_classfr   Random###myrandom_classfr
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    feats
## All.X##rcv#glmnet          Q115611.fctr,Q113181.fctr,Q98197.fctr,Q116881.fctr,Q108855.fctr,Q106272.fctr,Q122771.fctr,Q123621.fctr,Q106388.fctr,Q110740.fctr,Q122769.fctr,Q120472.fctr,Q101596.fctr,Q119334.fctr,Q114152.fctr,Q98869.fctr,Q115899.fctr,Q116797.fctr,Q118232.fctr,Gender.fctr,Q105655.fctr,Q99480.fctr,Q123464.fctr,Q120650.fctr,Q122120.fctr,Q107869.fctr,Q120014.fctr,Q102289.fctr,Income.fctr,Q122770.fctr,Q111580.fctr,Q116601.fctr,Q117186.fctr,Q106993.fctr,Q112270.fctr,Q101162.fctr,Q108856.fctr,Q117193.fctr,Q116441.fctr,Q119851.fctr,Q111848.fctr,Q98578.fctr,Q118892.fctr,Q114386.fctr,Q120978.fctr,Q112512.fctr,Q102674.fctr,Q96024.fctr,Q108950.fctr,Q115610.fctr,YOB.Age.fctr,Q112478.fctr,Q116197.fctr,Q124742.fctr,Q106389.fctr,Edn.fctr,Q118117.fctr,Q100562.fctr,Q107491.fctr,Q116448.fctr,Q108754.fctr,Q116953.fctr,Q115602.fctr,Q118233.fctr,Q120012.fctr,Q118237.fctr,Q99581.fctr,.rnorm,Q120194.fctr,Q115777.fctr,Q106997.fctr,Q100680.fctr,Q113584.fctr,Q108343.fctr,Q121700.fctr,Q105840.fctr,Q120379.fctr,Q103293.fctr,Q124122.fctr,Q109367.fctr,Q113992.fctr,Q121699.fctr,Q121011.fctr,Q114748.fctr,Q106042.fctr,Q111220.fctr,Q114517.fctr,Q102687.fctr,Q102906.fctr,Q98078.fctr,Q115390.fctr,Q102089.fctr,Q100010.fctr,Q99982.fctr,Q113583.fctr,Q108342.fctr,Q104996.fctr,Q119650.fctr,Q100689.fctr,Q108617.fctr,Q115195.fctr,Q99716.fctr,Q101163.fctr,Q98059.fctr,Q114961.fctr,Hhold.fctr,Hhold.fctr:.clusterid.fctr,YOB.Age.fctr:YOB.Age.dff
## Low.cor.X##rcv#glmnet      Q115611.fctr,Q113181.fctr,Q98197.fctr,Q116881.fctr,Q108855.fctr,Q106272.fctr,Q122771.fctr,Q123621.fctr,Q106388.fctr,Q110740.fctr,Q122769.fctr,Q120472.fctr,Q101596.fctr,Q119334.fctr,Q114152.fctr,Q98869.fctr,Q115899.fctr,Q116797.fctr,Q118232.fctr,Gender.fctr,Q105655.fctr,Q99480.fctr,Q123464.fctr,Q120650.fctr,Q122120.fctr,Q107869.fctr,Q120014.fctr,Q102289.fctr,Income.fctr,Q122770.fctr,Q111580.fctr,Q116601.fctr,Q117186.fctr,Q106993.fctr,Q112270.fctr,Q101162.fctr,Q108856.fctr,Q117193.fctr,Q116441.fctr,Q119851.fctr,Q111848.fctr,Q98578.fctr,Q118892.fctr,Q114386.fctr,Q120978.fctr,Q112512.fctr,Q102674.fctr,Q96024.fctr,Q108950.fctr,Q115610.fctr,YOB.Age.fctr,Q112478.fctr,Q116197.fctr,Q124742.fctr,Q106389.fctr,Edn.fctr,Q118117.fctr,Q100562.fctr,Q107491.fctr,Q116448.fctr,Q108754.fctr,Q116953.fctr,Q115602.fctr,Q118233.fctr,Q120012.fctr,Q118237.fctr,Q99581.fctr,.rnorm,Q120194.fctr,Q115777.fctr,Q106997.fctr,Q100680.fctr,Q113584.fctr,Q108343.fctr,Q121700.fctr,Q105840.fctr,Q120379.fctr,Q103293.fctr,Q124122.fctr,Q109367.fctr,Q113992.fctr,Q121699.fctr,Q121011.fctr,Q114748.fctr,Q106042.fctr,Q111220.fctr,Q114517.fctr,Q102687.fctr,Q102906.fctr,Q98078.fctr,Q115390.fctr,Q102089.fctr,Q100010.fctr,Q99982.fctr,Q113583.fctr,Q108342.fctr,Q104996.fctr,Q119650.fctr,Q100689.fctr,Q108617.fctr,Q115195.fctr,Q99716.fctr,Q101163.fctr,Q98059.fctr,Q114961.fctr,Hhold.fctr,Hhold.fctr:.clusterid.fctr,YOB.Age.fctr:YOB.Age.dff
## Max.cor.Y.rcv.1X1###glmnet                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     Q115611.fctr,Q113181.fctr
## Max.cor.Y##rcv#rpart                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           Q115611.fctr,Q113181.fctr
## Random###myrandom_classfr                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         .rnorm
##                            max.nTuningRuns min.elapsedtime.everything
## All.X##rcv#glmnet                       25                     13.519
## Low.cor.X##rcv#glmnet                   25                     14.590
## Max.cor.Y.rcv.1X1###glmnet               0                      0.766
## Max.cor.Y##rcv#rpart                     5                      1.468
## Random###myrandom_classfr                0                      0.272
##                            min.elapsedtime.final max.AUCpROC.fit
## All.X##rcv#glmnet                          1.332       0.5916814
## Low.cor.X##rcv#glmnet                      1.337       0.6219660
## Max.cor.Y.rcv.1X1###glmnet                 0.031       0.5862754
## Max.cor.Y##rcv#rpart                       0.012       0.5862754
## Random###myrandom_classfr                  0.002       0.4824581
##                            max.Sens.fit max.Spec.fit max.AUCROCR.fit
## All.X##rcv#glmnet             0.3325243    0.8508385       0.6797696
## Low.cor.X##rcv#glmnet         0.3992718    0.8446602       0.6998930
## Max.cor.Y.rcv.1X1###glmnet    0.4029126    0.7696381       0.6223104
## Max.cor.Y##rcv#rpart          0.4029126    0.7696381       0.5949108
## Random###myrandom_classfr     0.3956311    0.5692851       0.5146734
##                            opt.prob.threshold.fit max.f.score.fit
## All.X##rcv#glmnet                            0.55       0.7026116
## Low.cor.X##rcv#glmnet                        0.55       0.7180805
## Max.cor.Y.rcv.1X1###glmnet                   0.50       0.6984381
## Max.cor.Y##rcv#rpart                         0.50       0.6984381
## Random###myrandom_classfr                    0.40       0.7333333
##                            max.Accuracy.fit max.AccuracyLower.fit
## All.X##rcv#glmnet                 0.6126764             0.6175160
## Low.cor.X##rcv#glmnet             0.6128487             0.6423517
## Max.cor.Y.rcv.1X1###glmnet        0.6152274             0.5932560
## Max.cor.Y##rcv#rpart              0.6136958             0.5932560
## Random###myrandom_classfr         0.5789474             0.5567125
##                            max.AccuracyUpper.fit max.Kappa.fit
## All.X##rcv#glmnet                      0.6605534     0.1537844
## Low.cor.X##rcv#glmnet                  0.6846987     0.1649007
## Max.cor.Y.rcv.1X1###glmnet             0.6368528     0.1794092
## Max.cor.Y##rcv#rpart                   0.6368528     0.1758050
## Random###myrandom_classfr              0.6009453     0.0000000
##                            max.AUCpROC.OOB max.Sens.OOB max.Spec.OOB
## All.X##rcv#glmnet                0.5541115    0.3130841    0.7951389
## Low.cor.X##rcv#glmnet            0.5554420    0.3504673    0.7604167
## Max.cor.Y.rcv.1X1###glmnet       0.5468912    0.3785047    0.7152778
## Max.cor.Y##rcv#rpart             0.5468912    0.3785047    0.7152778
## Random###myrandom_classfr        0.4990752    0.4252336    0.5729167
##                            max.AUCROCR.OOB opt.prob.threshold.OOB
## All.X##rcv#glmnet                0.5814512                   0.50
## Low.cor.X##rcv#glmnet            0.5688766                   0.50
## Max.cor.Y.rcv.1X1###glmnet       0.5719513                   0.55
## Max.cor.Y##rcv#rpart             0.5452362                   0.40
## Random###myrandom_classfr        0.5181075                   0.40
##                            max.f.score.OOB max.Accuracy.OOB
## All.X##rcv#glmnet                0.6897590        0.5896414
## Low.cor.X##rcv#glmnet            0.6780186        0.5856574
## Max.cor.Y.rcv.1X1###glmnet       0.6467662        0.5756972
## Max.cor.Y##rcv#rpart             0.7291139        0.5737052
## Random###myrandom_classfr        0.7291139        0.5737052
##                            max.AccuracyLower.OOB max.AccuracyUpper.OOB
## All.X##rcv#glmnet                      0.5451919             0.6330291
## Low.cor.X##rcv#glmnet                  0.5411697             0.6291304
## Max.cor.Y.rcv.1X1###glmnet             0.5311268             0.6193710
## Max.cor.Y##rcv#rpart                   0.5291204             0.6174170
## Random###myrandom_classfr              0.5291204             0.6174170
##                            max.Kappa.OOB max.AccuracySD.fit
## All.X##rcv#glmnet              0.1142593        0.010022211
## Low.cor.X##rcv#glmnet          0.1157481        0.009997796
## Max.cor.Y.rcv.1X1###glmnet     0.1182524                 NA
## Max.cor.Y##rcv#rpart           0.0000000        0.010619247
## Random###myrandom_classfr      0.0000000                 NA
##                            max.KappaSD.fit
## All.X##rcv#glmnet               0.01937522
## Low.cor.X##rcv#glmnet           0.01935600
## Max.cor.Y.rcv.1X1###glmnet              NA
## Max.cor.Y##rcv#rpart            0.02237201
## Random###myrandom_classfr               NA
## [1] "myfit_mdl: enter: 0.000000 secs"
## [1] "myfit_mdl: fitting model: All.X#zv#rcv#glmnet"
## [1] "    indepVar: Q115611.fctr,Q113181.fctr,Q98197.fctr,Q116881.fctr,Q108855.fctr,Q106272.fctr,Q122771.fctr,Q123621.fctr,Q106388.fctr,Q110740.fctr,Q122769.fctr,Q120472.fctr,Q101596.fctr,Q119334.fctr,Q114152.fctr,Q98869.fctr,Q115899.fctr,Q116797.fctr,Q118232.fctr,Gender.fctr,Q105655.fctr,Q99480.fctr,Q123464.fctr,Q120650.fctr,Q122120.fctr,Q107869.fctr,Q120014.fctr,Q102289.fctr,Income.fctr,Q122770.fctr,Q111580.fctr,Q116601.fctr,Q117186.fctr,Q106993.fctr,Q112270.fctr,Q101162.fctr,Q108856.fctr,Q117193.fctr,Q116441.fctr,Q119851.fctr,Q111848.fctr,Q98578.fctr,Q118892.fctr,Q114386.fctr,Q120978.fctr,Q112512.fctr,Q102674.fctr,Q96024.fctr,Q108950.fctr,Q115610.fctr,YOB.Age.fctr,Q112478.fctr,Q116197.fctr,Q124742.fctr,Q106389.fctr,Edn.fctr,Q118117.fctr,Q100562.fctr,Q107491.fctr,Q116448.fctr,Q108754.fctr,Q116953.fctr,Q115602.fctr,Q118233.fctr,Q120012.fctr,Q118237.fctr,Q99581.fctr,.rnorm,Q120194.fctr,Q115777.fctr,Q106997.fctr,Q100680.fctr,Q113584.fctr,Q108343.fctr,Q121700.fctr,Q105840.fctr,Q120379.fctr,Q103293.fctr,Q124122.fctr,Q109367.fctr,Q113992.fctr,Q121699.fctr,Q121011.fctr,Q114748.fctr,Q106042.fctr,Q111220.fctr,Q114517.fctr,Q102687.fctr,Q102906.fctr,Q98078.fctr,Q115390.fctr,Q102089.fctr,Q100010.fctr,Q99982.fctr,Q113583.fctr,Q108342.fctr,Q104996.fctr,Q119650.fctr,Q100689.fctr,Q108617.fctr,Q115195.fctr,Q99716.fctr,Q101163.fctr,Q98059.fctr,Q114961.fctr,Hhold.fctr,Hhold.fctr:.clusterid.fctr,YOB.Age.fctr:YOB.Age.dff"
## [1] "myfit_mdl: setup complete: 0.675000 secs"
## Loading required package: glmnet
## Loading required package: Matrix
## Loaded glmnet 2.0-5
## Aggregating results
## Selecting tuning parameters
## Fitting alpha = 0.325, lambda = 0.0333 on full training set
## [1] "myfit_mdl: train complete: 15.924000 secs"
## Warning in myfit_mdl(mdl_specs_lst = myinit_mdl_specs_lst(mdl_specs_lst =
## list(id.prefix = bstMdlIdComponents$family, : model's bestTune found at an
## extreme of tuneGrid for parameter: lambda

##             Length Class      Mode     
## a0             85  -none-     numeric  
## beta        21760  dgCMatrix  S4       
## df             85  -none-     numeric  
## dim             2  -none-     numeric  
## lambda         85  -none-     numeric  
## dev.ratio      85  -none-     numeric  
## nulldev         1  -none-     numeric  
## npasses         1  -none-     numeric  
## jerr            1  -none-     numeric  
## offset          1  -none-     logical  
## classnames      2  -none-     character
## call            5  -none-     call     
## nobs            1  -none-     numeric  
## lambdaOpt       1  -none-     numeric  
## xNames        256  -none-     character
## problemType     1  -none-     character
## tuneValue       2  data.frame list     
## obsLevels       2  -none-     character
## [1] "min lambda > lambdaOpt:"
##                     (Intercept)                   Hhold.fctrMKy 
##                    0.2689370104                    0.1223388126 
##                   Hhold.fctrPKn                   Hhold.fctrPKy 
##                   -0.5431418661                   -0.6618709561 
##                   Hhold.fctrSKy                   Income.fctr.Q 
##                   -0.1090177325                    0.0980362635 
##                   Income.fctr.C                   Income.fctr^6 
##                    0.1010397569                   -0.0558545740 
##                  Q100562.fctrNo                 Q100689.fctrYes 
##                   -0.1227211571                   -0.0242725337 
##                 Q101163.fctrDad                 Q102089.fctrOwn 
##                    0.1609136964                    0.0213110713 
##                 Q104996.fctrYes                 Q105655.fctrYes 
##                   -0.0733859891                    0.0994923204 
##                  Q106272.fctrNo                 Q106272.fctrYes 
##                   -0.0985282958                    0.0109728198 
##                 Q106388.fctrYes                  Q106997.fctrGr 
##                    0.0222597292                    0.1722153193 
##                  Q106997.fctrYy              Q108855.fctrUmm... 
##                   -0.0005482815                   -0.0640940960 
##                Q108855.fctrYes!                  Q109367.fctrNo 
##                    0.0043637645                    0.0776512027 
##                 Q109367.fctrYes                  Q110740.fctrPC 
##                   -0.0232319681                    0.0617129947 
##                  Q112512.fctrNo                  Q113181.fctrNo 
##                   -0.0089942731                   -0.2565348387 
##                 Q113181.fctrYes          Q114386.fctrMysterious 
##                    0.0883115008                   -0.0488277360 
##                  Q114517.fctrNo                  Q115390.fctrNo 
##                   -0.0891692654                    0.0037303385 
##                  Q115611.fctrNo                 Q115611.fctrYes 
##                   -0.0867549557                    0.2945956632 
##                  Q115899.fctrCs                  Q116601.fctrNo 
##                   -0.0700586145                   -0.0530411889 
##               Q116881.fctrHappy               Q116881.fctrRight 
##                   -0.0660674927                    0.2077280095 
##                  Q116953.fctrNo      Q117193.fctrStandard hours 
##                    0.0531229393                    0.0358169094 
##                  Q118892.fctrNo              Q119650.fctrGiving 
##                   -0.0768159368                    0.1151091086 
##         Q120194.fctrStudy first                 Q120379.fctrYes 
##                   -0.0034275168                   -0.0337302239 
##             Q120472.fctrScience                 Q122769.fctrYes 
##                    0.0750873634                    0.0270370204 
##                  Q122771.fctrPt                 Q123464.fctrYes 
##                    0.0093972520                    0.0018784552 
##                 Q123621.fctrYes                  Q124742.fctrNo 
##                    0.0702491183                   -0.1091270840 
##                   Q96024.fctrNo                   Q98197.fctrNo 
##                   -0.0097694988                   -0.1666944739 
##                   Q98869.fctrNo                   Q99480.fctrNo 
##                   -0.1988235708                   -0.1985567368 
##                  Q99480.fctrYes                  Q99716.fctrYes 
##                    0.0163095000                   -0.0848727311 
##  Hhold.fctrSKn:.clusterid.fctr2  Hhold.fctrSKy:.clusterid.fctr3 
##                    0.0972361315                   -0.2486718925 
##    Hhold.fctrN:.clusterid.fctr4  Hhold.fctrMKy:.clusterid.fctr4 
##                    0.2316323732                    0.0799692788 
##  Hhold.fctrPKy:.clusterid.fctr4 YOB.Age.fctr(25,30]:YOB.Age.dff 
##                    1.0850351271                    0.0174906316 
## YOB.Age.fctr(35,40]:YOB.Age.dff 
##                   -0.0338654783 
## [1] "max lambda < lambdaOpt:"
##                     (Intercept)                   Hhold.fctrMKy 
##                    0.2687574078                    0.1268980348 
##                   Hhold.fctrPKn                   Hhold.fctrPKy 
##                   -0.5667951509                   -0.7360179842 
##                   Hhold.fctrSKy                   Income.fctr.Q 
##                   -0.1223613415                    0.1076270135 
##                   Income.fctr.C                   Income.fctr^6 
##                    0.1181824886                   -0.0677662807 
##                  Q100562.fctrNo                 Q100689.fctrYes 
##                   -0.1336075822                   -0.0361502891 
##                 Q101163.fctrDad                 Q102089.fctrOwn 
##                    0.1686107441                    0.0295085694 
##                 Q104996.fctrYes                 Q105655.fctrYes 
##                   -0.0849702314                    0.1075000884 
##                  Q106272.fctrNo                 Q106272.fctrYes 
##                   -0.1055147182                    0.0127575171 
##                 Q106388.fctrYes                  Q106997.fctrGr 
##                    0.0276876095                    0.1820281443 
##                  Q106997.fctrYy              Q108855.fctrUmm... 
##                   -0.0075273343                   -0.0728898757 
##                Q108855.fctrYes!                  Q109367.fctrNo 
##                    0.0041288338                    0.0844117618 
##                 Q109367.fctrYes                  Q110740.fctrPC 
##                   -0.0244431062                    0.0676957492 
##                  Q112512.fctrNo                  Q113181.fctrNo 
##                   -0.0209172822                   -0.2616295419 
##                 Q113181.fctrYes          Q114386.fctrMysterious 
##                    0.0851082794                   -0.0595585781 
##                  Q114517.fctrNo                  Q115390.fctrNo 
##                   -0.1000702347                    0.0122548916 
##                  Q115611.fctrNo                 Q115611.fctrYes 
##                   -0.0839508900                    0.3033680414 
##                  Q115899.fctrCs                Q116197.fctrA.M. 
##                   -0.0787815553                    0.0025657763 
##                  Q116601.fctrNo               Q116881.fctrHappy 
##                   -0.0643774543                   -0.0725092183 
##               Q116881.fctrRight                  Q116953.fctrNo 
##                    0.2118371133                    0.0609143935 
##      Q117193.fctrStandard hours                 Q118233.fctrYes 
##                    0.0462755734                   -0.0004803217 
##                  Q118892.fctrNo              Q119650.fctrGiving 
##                   -0.0889319734                    0.1258648670 
##         Q120194.fctrStudy first                 Q120379.fctrYes 
##                   -0.0111318453                   -0.0460010967 
##             Q120472.fctrScience                 Q122120.fctrYes 
##                    0.0857212012                    0.0087862652 
##                 Q122769.fctrYes                  Q122771.fctrPt 
##                    0.0340947285                    0.0181767014 
##                 Q123464.fctrYes                 Q123621.fctrYes 
##                    0.0299377349                    0.0757128321 
##                  Q124742.fctrNo                   Q96024.fctrNo 
##                   -0.1201268773                   -0.0136151428 
##                  Q98059.fctrYes                   Q98197.fctrNo 
##                   -0.0008977055                   -0.1704429347 
##                   Q98869.fctrNo                   Q99480.fctrNo 
##                   -0.2057924299                   -0.2024638922 
##                  Q99480.fctrYes                  Q99716.fctrYes 
##                    0.0226409850                   -0.0981662351 
##  Hhold.fctrPKy:.clusterid.fctr2  Hhold.fctrSKn:.clusterid.fctr2 
##                   -0.0058086382                    0.1098872900 
##  Hhold.fctrSKy:.clusterid.fctr3    Hhold.fctrN:.clusterid.fctr4 
##                   -0.2880193501                    0.2766211491 
##  Hhold.fctrMKy:.clusterid.fctr4  Hhold.fctrPKy:.clusterid.fctr4 
##                    0.0932839092                    1.2878098547 
## YOB.Age.fctr(25,30]:YOB.Age.dff YOB.Age.fctr(35,40]:YOB.Age.dff 
##                    0.0216901093                   -0.0381595075 
## [1] "myfit_mdl: train diagnostics complete: 16.448000 secs"
## Loading required namespace: pROC
## Loading required package: ROCR
## Loading required package: gplots
## 
## Attaching package: 'gplots'
## The following object is masked from 'package:stats':
## 
##     lowess

## Loading required package: sqldf
## Loading required package: gsubfn
## Loading required package: proto
## Loading required package: RSQLite
## Loading required package: DBI
## Loading required package: tcltk

##          Prediction
## Reference   D   R
##         D 461 363
##         R 295 838
##       Accuracy          Kappa  AccuracyLower  AccuracyUpper   AccuracyNull 
##   6.637711e-01   3.024994e-01   6.423517e-01   6.846987e-01   5.789474e-01 
## AccuracyPValue  McnemarPValue 
##   8.843720e-15   9.003218e-03

## [1] "mypredict_mdl: maxMetricDf:"
##    threshold   f.score  accuracy
## 10      0.45 0.7078652 0.5856574
## 11      0.50 0.6780186 0.5856574

##          Prediction
## Reference   D   R
##         D  75 139
##         R  69 219
##       Accuracy          Kappa  AccuracyLower  AccuracyUpper   AccuracyNull 
##   5.856574e-01   1.157481e-01   5.411697e-01   6.291304e-01   5.737052e-01 
## AccuracyPValue  McnemarPValue 
##   3.104270e-01   1.715935e-06 
## [1] "myfit_mdl: predict complete: 31.041000 secs"
##                    id
## 1 All.X#zv#rcv#glmnet
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           feats
## 1 Q115611.fctr,Q113181.fctr,Q98197.fctr,Q116881.fctr,Q108855.fctr,Q106272.fctr,Q122771.fctr,Q123621.fctr,Q106388.fctr,Q110740.fctr,Q122769.fctr,Q120472.fctr,Q101596.fctr,Q119334.fctr,Q114152.fctr,Q98869.fctr,Q115899.fctr,Q116797.fctr,Q118232.fctr,Gender.fctr,Q105655.fctr,Q99480.fctr,Q123464.fctr,Q120650.fctr,Q122120.fctr,Q107869.fctr,Q120014.fctr,Q102289.fctr,Income.fctr,Q122770.fctr,Q111580.fctr,Q116601.fctr,Q117186.fctr,Q106993.fctr,Q112270.fctr,Q101162.fctr,Q108856.fctr,Q117193.fctr,Q116441.fctr,Q119851.fctr,Q111848.fctr,Q98578.fctr,Q118892.fctr,Q114386.fctr,Q120978.fctr,Q112512.fctr,Q102674.fctr,Q96024.fctr,Q108950.fctr,Q115610.fctr,YOB.Age.fctr,Q112478.fctr,Q116197.fctr,Q124742.fctr,Q106389.fctr,Edn.fctr,Q118117.fctr,Q100562.fctr,Q107491.fctr,Q116448.fctr,Q108754.fctr,Q116953.fctr,Q115602.fctr,Q118233.fctr,Q120012.fctr,Q118237.fctr,Q99581.fctr,.rnorm,Q120194.fctr,Q115777.fctr,Q106997.fctr,Q100680.fctr,Q113584.fctr,Q108343.fctr,Q121700.fctr,Q105840.fctr,Q120379.fctr,Q103293.fctr,Q124122.fctr,Q109367.fctr,Q113992.fctr,Q121699.fctr,Q121011.fctr,Q114748.fctr,Q106042.fctr,Q111220.fctr,Q114517.fctr,Q102687.fctr,Q102906.fctr,Q98078.fctr,Q115390.fctr,Q102089.fctr,Q100010.fctr,Q99982.fctr,Q113583.fctr,Q108342.fctr,Q104996.fctr,Q119650.fctr,Q100689.fctr,Q108617.fctr,Q115195.fctr,Q99716.fctr,Q101163.fctr,Q98059.fctr,Q114961.fctr,Hhold.fctr,Hhold.fctr:.clusterid.fctr,YOB.Age.fctr:YOB.Age.dff
##   max.nTuningRuns min.elapsedtime.everything min.elapsedtime.final
## 1              25                     14.938                 1.421
##   max.AUCpROC.fit max.Sens.fit max.Spec.fit max.AUCROCR.fit
## 1        0.621966    0.3992718    0.8446602        0.699893
##   opt.prob.threshold.fit max.f.score.fit max.Accuracy.fit
## 1                   0.55       0.7180805        0.6128487
##   max.AccuracyLower.fit max.AccuracyUpper.fit max.Kappa.fit
## 1             0.6423517             0.6846987     0.1649007
##   max.AUCpROC.OOB max.Sens.OOB max.Spec.OOB max.AUCROCR.OOB
## 1        0.555442    0.3504673    0.7604167       0.5688766
##   opt.prob.threshold.OOB max.f.score.OOB max.Accuracy.OOB
## 1                    0.5       0.6780186        0.5856574
##   max.AccuracyLower.OOB max.AccuracyUpper.OOB max.Kappa.OOB
## 1             0.5411697             0.6291304     0.1157481
##   max.AccuracySD.fit max.KappaSD.fit
## 1        0.009997796        0.019356
## [1] "myfit_mdl: exit: 31.335000 secs"
## [1] "myfit_mdl: enter: 0.000000 secs"
## [1] "myfit_mdl: fitting model: All.X#nzv#rcv#glmnet"
## [1] "    indepVar: Q115611.fctr,Q113181.fctr,Q98197.fctr,Q116881.fctr,Q108855.fctr,Q106272.fctr,Q122771.fctr,Q123621.fctr,Q106388.fctr,Q110740.fctr,Q122769.fctr,Q120472.fctr,Q101596.fctr,Q119334.fctr,Q114152.fctr,Q98869.fctr,Q115899.fctr,Q116797.fctr,Q118232.fctr,Gender.fctr,Q105655.fctr,Q99480.fctr,Q123464.fctr,Q120650.fctr,Q122120.fctr,Q107869.fctr,Q120014.fctr,Q102289.fctr,Income.fctr,Q122770.fctr,Q111580.fctr,Q116601.fctr,Q117186.fctr,Q106993.fctr,Q112270.fctr,Q101162.fctr,Q108856.fctr,Q117193.fctr,Q116441.fctr,Q119851.fctr,Q111848.fctr,Q98578.fctr,Q118892.fctr,Q114386.fctr,Q120978.fctr,Q112512.fctr,Q102674.fctr,Q96024.fctr,Q108950.fctr,Q115610.fctr,YOB.Age.fctr,Q112478.fctr,Q116197.fctr,Q124742.fctr,Q106389.fctr,Edn.fctr,Q118117.fctr,Q100562.fctr,Q107491.fctr,Q116448.fctr,Q108754.fctr,Q116953.fctr,Q115602.fctr,Q118233.fctr,Q120012.fctr,Q118237.fctr,Q99581.fctr,.rnorm,Q120194.fctr,Q115777.fctr,Q106997.fctr,Q100680.fctr,Q113584.fctr,Q108343.fctr,Q121700.fctr,Q105840.fctr,Q120379.fctr,Q103293.fctr,Q124122.fctr,Q109367.fctr,Q113992.fctr,Q121699.fctr,Q121011.fctr,Q114748.fctr,Q106042.fctr,Q111220.fctr,Q114517.fctr,Q102687.fctr,Q102906.fctr,Q98078.fctr,Q115390.fctr,Q102089.fctr,Q100010.fctr,Q99982.fctr,Q113583.fctr,Q108342.fctr,Q104996.fctr,Q119650.fctr,Q100689.fctr,Q108617.fctr,Q115195.fctr,Q99716.fctr,Q101163.fctr,Q98059.fctr,Q114961.fctr,Hhold.fctr,Hhold.fctr:.clusterid.fctr,YOB.Age.fctr:YOB.Age.dff"
## [1] "myfit_mdl: setup complete: 0.692000 secs"
## Aggregating results
## Selecting tuning parameters
## Fitting alpha = 0.55, lambda = 0.0333 on full training set
## [1] "myfit_mdl: train complete: 18.761000 secs"
## Warning in myfit_mdl(mdl_specs_lst = myinit_mdl_specs_lst(mdl_specs_lst =
## list(id.prefix = bstMdlIdComponents$family, : model's bestTune found at an
## extreme of tuneGrid for parameter: lambda

##             Length Class      Mode     
## a0             81  -none-     numeric  
## beta        18792  dgCMatrix  S4       
## df             81  -none-     numeric  
## dim             2  -none-     numeric  
## lambda         81  -none-     numeric  
## dev.ratio      81  -none-     numeric  
## nulldev         1  -none-     numeric  
## npasses         1  -none-     numeric  
## jerr            1  -none-     numeric  
## offset          1  -none-     logical  
## classnames      2  -none-     character
## call            5  -none-     call     
## nobs            1  -none-     numeric  
## lambdaOpt       1  -none-     numeric  
## xNames        232  -none-     character
## problemType     1  -none-     character
## tuneValue       2  data.frame list     
## obsLevels       2  -none-     character
## [1] "min lambda > lambdaOpt:"
##                    (Intercept)                  Hhold.fctrMKy 
##                   0.2565760820                   0.1125625578 
##                  Income.fctr.Q                 Q100562.fctrNo 
##                   0.0200881983                  -0.0400552280 
##                Q101163.fctrDad                Q105655.fctrYes 
##                   0.1114222972                   0.0415974299 
##                 Q106272.fctrNo                 Q106997.fctrGr 
##                  -0.0350825878                   0.0705821294 
##                 Q109367.fctrNo                Q109367.fctrYes 
##                   0.0355563673                  -0.0009344203 
##                 Q110740.fctrPC                 Q113181.fctrNo 
##                   0.0192606125                  -0.2538213951 
##                Q113181.fctrYes                 Q114517.fctrNo 
##                   0.0854754192                  -0.0085934803 
##                 Q115611.fctrNo                Q115611.fctrYes 
##                  -0.0832291029                   0.2685997936 
##                 Q115899.fctrCs              Q116881.fctrHappy 
##                  -0.0133073619                  -0.0135347230 
##              Q116881.fctrRight             Q119650.fctrGiving 
##                   0.1949058077                   0.0453286052 
##            Q120472.fctrScience                Q123621.fctrYes 
##                   0.0049214276                   0.0250694369 
##                 Q124742.fctrNo                  Q98197.fctrNo 
##                  -0.0340011366                  -0.1477656293 
##                  Q98869.fctrNo                  Q99480.fctrNo 
##                  -0.1550703264                  -0.1523444492 
## Hhold.fctrSKn:.clusterid.fctr2 
##                   0.0050961491 
## [1] "max lambda < lambdaOpt:"
##                    (Intercept)                  Hhold.fctrMKy 
##                    0.246963564                    0.126012884 
##                  Income.fctr.Q                 Q100562.fctrNo 
##                    0.039957505                   -0.056190085 
##                Q101163.fctrDad                Q104996.fctrYes 
##                    0.123431947                   -0.010959019 
##                Q105655.fctrYes                 Q106272.fctrNo 
##                    0.057402644                   -0.048879633 
##                 Q106997.fctrGr             Q108855.fctrUmm... 
##                    0.090516881                   -0.010817275 
##                 Q109367.fctrNo                Q109367.fctrYes 
##                    0.047480481                   -0.007017792 
##                 Q110740.fctrPC                 Q113181.fctrNo 
##                    0.031675542                   -0.259122410 
##                Q113181.fctrYes                 Q114517.fctrNo 
##                    0.082276233                   -0.026920366 
##                 Q115611.fctrNo                Q115611.fctrYes 
##                   -0.082696330                    0.277749314 
##                 Q115899.fctrCs              Q116881.fctrHappy 
##                   -0.025710723                   -0.025669655 
##              Q116881.fctrRight                 Q118892.fctrNo 
##                    0.199437752                   -0.002586438 
##             Q119650.fctrGiving            Q120472.fctrScience 
##                    0.059960865                    0.016348743 
##                Q123621.fctrYes                 Q124742.fctrNo 
##                    0.031501643                   -0.051308646 
##                  Q98197.fctrNo                  Q98869.fctrNo 
##                   -0.151551929                   -0.168787585 
##                  Q99480.fctrNo Hhold.fctrSKn:.clusterid.fctr2 
##                   -0.164316195                    0.030388848 
## Hhold.fctrMKy:.clusterid.fctr4 
##                    0.007961082 
## [1] "myfit_mdl: train diagnostics complete: 19.416000 secs"

##          Prediction
## Reference   D   R
##         D 402 422
##         R 305 828
##       Accuracy          Kappa  AccuracyLower  AccuracyUpper   AccuracyNull 
##   6.285130e-01   2.229848e-01   6.066695e-01   6.499708e-01   5.789474e-01 
## AccuracyPValue  McnemarPValue 
##   4.406192e-06   1.691091e-05

## [1] "mypredict_mdl: maxMetricDf:"
##    threshold   f.score  accuracy
## 10      0.45 0.7167785 0.5796813
## 11      0.50 0.6827068 0.5796813
##          Prediction
## Reference   D   R
##         D  64 150
##         R  61 227
##       Accuracy          Kappa  AccuracyLower  AccuracyUpper   AccuracyNull 
##   5.796813e-01   9.218533e-02   5.351418e-01   6.232769e-01   5.737052e-01 
## AccuracyPValue  McnemarPValue 
##   4.115799e-01   1.376790e-09 
## [1] "myfit_mdl: predict complete: 29.138000 secs"
##                     id
## 1 All.X#nzv#rcv#glmnet
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           feats
## 1 Q115611.fctr,Q113181.fctr,Q98197.fctr,Q116881.fctr,Q108855.fctr,Q106272.fctr,Q122771.fctr,Q123621.fctr,Q106388.fctr,Q110740.fctr,Q122769.fctr,Q120472.fctr,Q101596.fctr,Q119334.fctr,Q114152.fctr,Q98869.fctr,Q115899.fctr,Q116797.fctr,Q118232.fctr,Gender.fctr,Q105655.fctr,Q99480.fctr,Q123464.fctr,Q120650.fctr,Q122120.fctr,Q107869.fctr,Q120014.fctr,Q102289.fctr,Income.fctr,Q122770.fctr,Q111580.fctr,Q116601.fctr,Q117186.fctr,Q106993.fctr,Q112270.fctr,Q101162.fctr,Q108856.fctr,Q117193.fctr,Q116441.fctr,Q119851.fctr,Q111848.fctr,Q98578.fctr,Q118892.fctr,Q114386.fctr,Q120978.fctr,Q112512.fctr,Q102674.fctr,Q96024.fctr,Q108950.fctr,Q115610.fctr,YOB.Age.fctr,Q112478.fctr,Q116197.fctr,Q124742.fctr,Q106389.fctr,Edn.fctr,Q118117.fctr,Q100562.fctr,Q107491.fctr,Q116448.fctr,Q108754.fctr,Q116953.fctr,Q115602.fctr,Q118233.fctr,Q120012.fctr,Q118237.fctr,Q99581.fctr,.rnorm,Q120194.fctr,Q115777.fctr,Q106997.fctr,Q100680.fctr,Q113584.fctr,Q108343.fctr,Q121700.fctr,Q105840.fctr,Q120379.fctr,Q103293.fctr,Q124122.fctr,Q109367.fctr,Q113992.fctr,Q121699.fctr,Q121011.fctr,Q114748.fctr,Q106042.fctr,Q111220.fctr,Q114517.fctr,Q102687.fctr,Q102906.fctr,Q98078.fctr,Q115390.fctr,Q102089.fctr,Q100010.fctr,Q99982.fctr,Q113583.fctr,Q108342.fctr,Q104996.fctr,Q119650.fctr,Q100689.fctr,Q108617.fctr,Q115195.fctr,Q99716.fctr,Q101163.fctr,Q98059.fctr,Q114961.fctr,Hhold.fctr,Hhold.fctr:.clusterid.fctr,YOB.Age.fctr:YOB.Age.dff
##   max.nTuningRuns min.elapsedtime.everything min.elapsedtime.final
## 1              25                     17.988                 2.055
##   max.AUCpROC.fit max.Sens.fit max.Spec.fit max.AUCROCR.fit
## 1       0.5833517    0.3167476    0.8499559       0.6669664
##   opt.prob.threshold.fit max.f.score.fit max.Accuracy.fit
## 1                   0.55       0.6949224         0.608759
##   max.AccuracyLower.fit max.AccuracyUpper.fit max.Kappa.fit
## 1             0.6066695             0.6499708     0.1427891
##   max.AUCpROC.OOB max.Sens.OOB max.Spec.OOB max.AUCROCR.OOB
## 1       0.5436299    0.2990654    0.7881944       0.5784657
##   opt.prob.threshold.OOB max.f.score.OOB max.Accuracy.OOB
## 1                    0.5       0.6827068        0.5796813
##   max.AccuracyLower.OOB max.AccuracyUpper.OOB max.Kappa.OOB
## 1             0.5351418             0.6232769    0.09218533
##   max.AccuracySD.fit max.KappaSD.fit
## 1         0.01208616      0.02260378
## [1] "myfit_mdl: exit: 29.425000 secs"
## [1] "myfit_mdl: enter: 0.001000 secs"
## [1] "myfit_mdl: fitting model: All.X#BoxCox#rcv#glmnet"
## [1] "    indepVar: Q115611.fctr,Q113181.fctr,Q98197.fctr,Q116881.fctr,Q108855.fctr,Q106272.fctr,Q122771.fctr,Q123621.fctr,Q106388.fctr,Q110740.fctr,Q122769.fctr,Q120472.fctr,Q101596.fctr,Q119334.fctr,Q114152.fctr,Q98869.fctr,Q115899.fctr,Q116797.fctr,Q118232.fctr,Gender.fctr,Q105655.fctr,Q99480.fctr,Q123464.fctr,Q120650.fctr,Q122120.fctr,Q107869.fctr,Q120014.fctr,Q102289.fctr,Income.fctr,Q122770.fctr,Q111580.fctr,Q116601.fctr,Q117186.fctr,Q106993.fctr,Q112270.fctr,Q101162.fctr,Q108856.fctr,Q117193.fctr,Q116441.fctr,Q119851.fctr,Q111848.fctr,Q98578.fctr,Q118892.fctr,Q114386.fctr,Q120978.fctr,Q112512.fctr,Q102674.fctr,Q96024.fctr,Q108950.fctr,Q115610.fctr,YOB.Age.fctr,Q112478.fctr,Q116197.fctr,Q124742.fctr,Q106389.fctr,Edn.fctr,Q118117.fctr,Q100562.fctr,Q107491.fctr,Q116448.fctr,Q108754.fctr,Q116953.fctr,Q115602.fctr,Q118233.fctr,Q120012.fctr,Q118237.fctr,Q99581.fctr,.rnorm,Q120194.fctr,Q115777.fctr,Q106997.fctr,Q100680.fctr,Q113584.fctr,Q108343.fctr,Q121700.fctr,Q105840.fctr,Q120379.fctr,Q103293.fctr,Q124122.fctr,Q109367.fctr,Q113992.fctr,Q121699.fctr,Q121011.fctr,Q114748.fctr,Q106042.fctr,Q111220.fctr,Q114517.fctr,Q102687.fctr,Q102906.fctr,Q98078.fctr,Q115390.fctr,Q102089.fctr,Q100010.fctr,Q99982.fctr,Q113583.fctr,Q108342.fctr,Q104996.fctr,Q119650.fctr,Q100689.fctr,Q108617.fctr,Q115195.fctr,Q99716.fctr,Q101163.fctr,Q98059.fctr,Q114961.fctr,Hhold.fctr,Hhold.fctr:.clusterid.fctr,YOB.Age.fctr:YOB.Age.dff"
## [1] "myfit_mdl: setup complete: 0.665000 secs"
## Aggregating results
## Selecting tuning parameters
## Fitting alpha = 0.325, lambda = 0.0333 on full training set
## Warning in is.na(lam): is.na() applied to non-(list or vector) of type
## 'NULL'

## [1] "myfit_mdl: train complete: 18.351000 secs"
## Warning in myfit_mdl(mdl_specs_lst = myinit_mdl_specs_lst(mdl_specs_lst =
## list(id.prefix = bstMdlIdComponents$family, : model's bestTune found at an
## extreme of tuneGrid for parameter: lambda

##             Length Class      Mode     
## a0             85  -none-     numeric  
## beta        22100  dgCMatrix  S4       
## df             85  -none-     numeric  
## dim             2  -none-     numeric  
## lambda         85  -none-     numeric  
## dev.ratio      85  -none-     numeric  
## nulldev         1  -none-     numeric  
## npasses         1  -none-     numeric  
## jerr            1  -none-     numeric  
## offset          1  -none-     logical  
## classnames      2  -none-     character
## call            5  -none-     call     
## nobs            1  -none-     numeric  
## lambdaOpt       1  -none-     numeric  
## xNames        260  -none-     character
## problemType     1  -none-     character
## tuneValue       2  data.frame list     
## obsLevels       2  -none-     character
## [1] "min lambda > lambdaOpt:"
##                     (Intercept)                   Hhold.fctrMKy 
##                    0.2689370104                    0.1223388126 
##                   Hhold.fctrPKn                   Hhold.fctrPKy 
##                   -0.5431418661                   -0.6618709561 
##                   Hhold.fctrSKy                   Income.fctr.Q 
##                   -0.1090177325                    0.0980362635 
##                   Income.fctr.C                   Income.fctr^6 
##                    0.1010397569                   -0.0558545740 
##                  Q100562.fctrNo                 Q100689.fctrYes 
##                   -0.1227211571                   -0.0242725337 
##                 Q101163.fctrDad                 Q102089.fctrOwn 
##                    0.1609136964                    0.0213110713 
##                 Q104996.fctrYes                 Q105655.fctrYes 
##                   -0.0733859891                    0.0994923204 
##                  Q106272.fctrNo                 Q106272.fctrYes 
##                   -0.0985282958                    0.0109728198 
##                 Q106388.fctrYes                  Q106997.fctrGr 
##                    0.0222597292                    0.1722153193 
##                  Q106997.fctrYy              Q108855.fctrUmm... 
##                   -0.0005482815                   -0.0640940960 
##                Q108855.fctrYes!                  Q109367.fctrNo 
##                    0.0043637645                    0.0776512027 
##                 Q109367.fctrYes                  Q110740.fctrPC 
##                   -0.0232319681                    0.0617129947 
##                  Q112512.fctrNo                  Q113181.fctrNo 
##                   -0.0089942731                   -0.2565348387 
##                 Q113181.fctrYes          Q114386.fctrMysterious 
##                    0.0883115008                   -0.0488277360 
##                  Q114517.fctrNo                  Q115390.fctrNo 
##                   -0.0891692654                    0.0037303385 
##                  Q115611.fctrNo                 Q115611.fctrYes 
##                   -0.0867549557                    0.2945956632 
##                  Q115899.fctrCs                  Q116601.fctrNo 
##                   -0.0700586145                   -0.0530411889 
##               Q116881.fctrHappy               Q116881.fctrRight 
##                   -0.0660674927                    0.2077280095 
##                  Q116953.fctrNo      Q117193.fctrStandard hours 
##                    0.0531229393                    0.0358169094 
##                  Q118892.fctrNo              Q119650.fctrGiving 
##                   -0.0768159368                    0.1151091086 
##         Q120194.fctrStudy first                 Q120379.fctrYes 
##                   -0.0034275168                   -0.0337302239 
##             Q120472.fctrScience                 Q122769.fctrYes 
##                    0.0750873634                    0.0270370204 
##                  Q122771.fctrPt                 Q123464.fctrYes 
##                    0.0093972520                    0.0018784552 
##                 Q123621.fctrYes                  Q124742.fctrNo 
##                    0.0702491183                   -0.1091270840 
##                   Q96024.fctrNo                   Q98197.fctrNo 
##                   -0.0097694988                   -0.1666944739 
##                   Q98869.fctrNo                   Q99480.fctrNo 
##                   -0.1988235708                   -0.1985567368 
##                  Q99480.fctrYes                  Q99716.fctrYes 
##                    0.0163095000                   -0.0848727311 
##  Hhold.fctrSKn:.clusterid.fctr2  Hhold.fctrSKy:.clusterid.fctr3 
##                    0.0972361315                   -0.2486718925 
##    Hhold.fctrN:.clusterid.fctr4  Hhold.fctrMKy:.clusterid.fctr4 
##                    0.2316323732                    0.0799692788 
##  Hhold.fctrPKy:.clusterid.fctr4 YOB.Age.fctr(25,30]:YOB.Age.dff 
##                    1.0850351271                    0.0174906316 
## YOB.Age.fctr(35,40]:YOB.Age.dff 
##                   -0.0338654783 
## [1] "max lambda < lambdaOpt:"
##                     (Intercept)                   Hhold.fctrMKy 
##                    0.2687574078                    0.1268980348 
##                   Hhold.fctrPKn                   Hhold.fctrPKy 
##                   -0.5667951509                   -0.7360179842 
##                   Hhold.fctrSKy                   Income.fctr.Q 
##                   -0.1223613415                    0.1076270135 
##                   Income.fctr.C                   Income.fctr^6 
##                    0.1181824886                   -0.0677662807 
##                  Q100562.fctrNo                 Q100689.fctrYes 
##                   -0.1336075822                   -0.0361502891 
##                 Q101163.fctrDad                 Q102089.fctrOwn 
##                    0.1686107441                    0.0295085694 
##                 Q104996.fctrYes                 Q105655.fctrYes 
##                   -0.0849702314                    0.1075000884 
##                  Q106272.fctrNo                 Q106272.fctrYes 
##                   -0.1055147182                    0.0127575171 
##                 Q106388.fctrYes                  Q106997.fctrGr 
##                    0.0276876095                    0.1820281443 
##                  Q106997.fctrYy              Q108855.fctrUmm... 
##                   -0.0075273343                   -0.0728898757 
##                Q108855.fctrYes!                  Q109367.fctrNo 
##                    0.0041288338                    0.0844117618 
##                 Q109367.fctrYes                  Q110740.fctrPC 
##                   -0.0244431062                    0.0676957492 
##                  Q112512.fctrNo                  Q113181.fctrNo 
##                   -0.0209172822                   -0.2616295419 
##                 Q113181.fctrYes          Q114386.fctrMysterious 
##                    0.0851082794                   -0.0595585781 
##                  Q114517.fctrNo                  Q115390.fctrNo 
##                   -0.1000702347                    0.0122548916 
##                  Q115611.fctrNo                 Q115611.fctrYes 
##                   -0.0839508900                    0.3033680414 
##                  Q115899.fctrCs                Q116197.fctrA.M. 
##                   -0.0787815553                    0.0025657763 
##                  Q116601.fctrNo               Q116881.fctrHappy 
##                   -0.0643774543                   -0.0725092183 
##               Q116881.fctrRight                  Q116953.fctrNo 
##                    0.2118371133                    0.0609143935 
##      Q117193.fctrStandard hours                 Q118233.fctrYes 
##                    0.0462755734                   -0.0004803217 
##                  Q118892.fctrNo              Q119650.fctrGiving 
##                   -0.0889319734                    0.1258648670 
##         Q120194.fctrStudy first                 Q120379.fctrYes 
##                   -0.0111318453                   -0.0460010967 
##             Q120472.fctrScience                 Q122120.fctrYes 
##                    0.0857212012                    0.0087862652 
##                 Q122769.fctrYes                  Q122771.fctrPt 
##                    0.0340947285                    0.0181767014 
##                 Q123464.fctrYes                 Q123621.fctrYes 
##                    0.0299377349                    0.0757128321 
##                  Q124742.fctrNo                   Q96024.fctrNo 
##                   -0.1201268773                   -0.0136151428 
##                  Q98059.fctrYes                   Q98197.fctrNo 
##                   -0.0008977055                   -0.1704429347 
##                   Q98869.fctrNo                   Q99480.fctrNo 
##                   -0.2057924299                   -0.2024638922 
##                  Q99480.fctrYes                  Q99716.fctrYes 
##                    0.0226409850                   -0.0981662351 
##  Hhold.fctrPKy:.clusterid.fctr2  Hhold.fctrSKn:.clusterid.fctr2 
##                   -0.0058086382                    0.1098872900 
##  Hhold.fctrSKy:.clusterid.fctr3    Hhold.fctrN:.clusterid.fctr4 
##                   -0.2880193501                    0.2766211491 
##  Hhold.fctrMKy:.clusterid.fctr4  Hhold.fctrPKy:.clusterid.fctr4 
##                    0.0932839092                    1.2878098547 
## YOB.Age.fctr(25,30]:YOB.Age.dff YOB.Age.fctr(35,40]:YOB.Age.dff 
##                    0.0216901093                   -0.0381595075 
## [1] "myfit_mdl: train diagnostics complete: 18.990000 secs"
## Warning in is.na(lam): is.na() applied to non-(list or vector) of type
## 'NULL'
## Warning in is.na(lam): is.na() applied to non-(list or vector) of type
## 'NULL'

##          Prediction
## Reference   D   R
##         D 461 363
##         R 295 838
##       Accuracy          Kappa  AccuracyLower  AccuracyUpper   AccuracyNull 
##   6.637711e-01   3.024994e-01   6.423517e-01   6.846987e-01   5.789474e-01 
## AccuracyPValue  McnemarPValue 
##   8.843720e-15   9.003218e-03
## Warning in is.na(lam): is.na() applied to non-(list or vector) of type
## 'NULL'

## Warning in is.na(lam): is.na() applied to non-(list or vector) of type
## 'NULL'

## [1] "mypredict_mdl: maxMetricDf:"
##    threshold   f.score  accuracy
## 10      0.45 0.7078652 0.5856574
## 11      0.50 0.6780186 0.5856574
##          Prediction
## Reference   D   R
##         D  75 139
##         R  69 219
##       Accuracy          Kappa  AccuracyLower  AccuracyUpper   AccuracyNull 
##   5.856574e-01   1.157481e-01   5.411697e-01   6.291304e-01   5.737052e-01 
## AccuracyPValue  McnemarPValue 
##   3.104270e-01   1.715935e-06 
## [1] "myfit_mdl: predict complete: 28.435000 secs"
##                        id
## 1 All.X#BoxCox#rcv#glmnet
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           feats
## 1 Q115611.fctr,Q113181.fctr,Q98197.fctr,Q116881.fctr,Q108855.fctr,Q106272.fctr,Q122771.fctr,Q123621.fctr,Q106388.fctr,Q110740.fctr,Q122769.fctr,Q120472.fctr,Q101596.fctr,Q119334.fctr,Q114152.fctr,Q98869.fctr,Q115899.fctr,Q116797.fctr,Q118232.fctr,Gender.fctr,Q105655.fctr,Q99480.fctr,Q123464.fctr,Q120650.fctr,Q122120.fctr,Q107869.fctr,Q120014.fctr,Q102289.fctr,Income.fctr,Q122770.fctr,Q111580.fctr,Q116601.fctr,Q117186.fctr,Q106993.fctr,Q112270.fctr,Q101162.fctr,Q108856.fctr,Q117193.fctr,Q116441.fctr,Q119851.fctr,Q111848.fctr,Q98578.fctr,Q118892.fctr,Q114386.fctr,Q120978.fctr,Q112512.fctr,Q102674.fctr,Q96024.fctr,Q108950.fctr,Q115610.fctr,YOB.Age.fctr,Q112478.fctr,Q116197.fctr,Q124742.fctr,Q106389.fctr,Edn.fctr,Q118117.fctr,Q100562.fctr,Q107491.fctr,Q116448.fctr,Q108754.fctr,Q116953.fctr,Q115602.fctr,Q118233.fctr,Q120012.fctr,Q118237.fctr,Q99581.fctr,.rnorm,Q120194.fctr,Q115777.fctr,Q106997.fctr,Q100680.fctr,Q113584.fctr,Q108343.fctr,Q121700.fctr,Q105840.fctr,Q120379.fctr,Q103293.fctr,Q124122.fctr,Q109367.fctr,Q113992.fctr,Q121699.fctr,Q121011.fctr,Q114748.fctr,Q106042.fctr,Q111220.fctr,Q114517.fctr,Q102687.fctr,Q102906.fctr,Q98078.fctr,Q115390.fctr,Q102089.fctr,Q100010.fctr,Q99982.fctr,Q113583.fctr,Q108342.fctr,Q104996.fctr,Q119650.fctr,Q100689.fctr,Q108617.fctr,Q115195.fctr,Q99716.fctr,Q101163.fctr,Q98059.fctr,Q114961.fctr,Hhold.fctr,Hhold.fctr:.clusterid.fctr,YOB.Age.fctr:YOB.Age.dff
##   max.nTuningRuns min.elapsedtime.everything min.elapsedtime.final
## 1              25                     17.604                 1.832
##   max.AUCpROC.fit max.Sens.fit max.Spec.fit max.AUCROCR.fit
## 1        0.621966    0.3992718    0.8446602        0.699893
##   opt.prob.threshold.fit max.f.score.fit max.Accuracy.fit
## 1                   0.55       0.7180805        0.6128487
##   max.AccuracyLower.fit max.AccuracyUpper.fit max.Kappa.fit
## 1             0.6423517             0.6846987     0.1649007
##   max.AUCpROC.OOB max.Sens.OOB max.Spec.OOB max.AUCROCR.OOB
## 1        0.555442    0.3504673    0.7604167       0.5688766
##   opt.prob.threshold.OOB max.f.score.OOB max.Accuracy.OOB
## 1                    0.5       0.6780186        0.5856574
##   max.AccuracyLower.OOB max.AccuracyUpper.OOB max.Kappa.OOB
## 1             0.5411697             0.6291304     0.1157481
##   max.AccuracySD.fit max.KappaSD.fit
## 1        0.009997796        0.019356
## Warning in is.na(lam): is.na() applied to non-(list or vector) of type
## 'NULL'

## [1] "myfit_mdl: exit: 28.710000 secs"
## [1] "myfit_mdl: enter: 0.001000 secs"
## [1] "myfit_mdl: fitting model: All.X#YeoJohnson#rcv#glmnet"
## [1] "    indepVar: Q115611.fctr,Q113181.fctr,Q98197.fctr,Q116881.fctr,Q108855.fctr,Q106272.fctr,Q122771.fctr,Q123621.fctr,Q106388.fctr,Q110740.fctr,Q122769.fctr,Q120472.fctr,Q101596.fctr,Q119334.fctr,Q114152.fctr,Q98869.fctr,Q115899.fctr,Q116797.fctr,Q118232.fctr,Gender.fctr,Q105655.fctr,Q99480.fctr,Q123464.fctr,Q120650.fctr,Q122120.fctr,Q107869.fctr,Q120014.fctr,Q102289.fctr,Income.fctr,Q122770.fctr,Q111580.fctr,Q116601.fctr,Q117186.fctr,Q106993.fctr,Q112270.fctr,Q101162.fctr,Q108856.fctr,Q117193.fctr,Q116441.fctr,Q119851.fctr,Q111848.fctr,Q98578.fctr,Q118892.fctr,Q114386.fctr,Q120978.fctr,Q112512.fctr,Q102674.fctr,Q96024.fctr,Q108950.fctr,Q115610.fctr,YOB.Age.fctr,Q112478.fctr,Q116197.fctr,Q124742.fctr,Q106389.fctr,Edn.fctr,Q118117.fctr,Q100562.fctr,Q107491.fctr,Q116448.fctr,Q108754.fctr,Q116953.fctr,Q115602.fctr,Q118233.fctr,Q120012.fctr,Q118237.fctr,Q99581.fctr,.rnorm,Q120194.fctr,Q115777.fctr,Q106997.fctr,Q100680.fctr,Q113584.fctr,Q108343.fctr,Q121700.fctr,Q105840.fctr,Q120379.fctr,Q103293.fctr,Q124122.fctr,Q109367.fctr,Q113992.fctr,Q121699.fctr,Q121011.fctr,Q114748.fctr,Q106042.fctr,Q111220.fctr,Q114517.fctr,Q102687.fctr,Q102906.fctr,Q98078.fctr,Q115390.fctr,Q102089.fctr,Q100010.fctr,Q99982.fctr,Q113583.fctr,Q108342.fctr,Q104996.fctr,Q119650.fctr,Q100689.fctr,Q108617.fctr,Q115195.fctr,Q99716.fctr,Q101163.fctr,Q98059.fctr,Q114961.fctr,Hhold.fctr,Hhold.fctr:.clusterid.fctr,YOB.Age.fctr:YOB.Age.dff"
## [1] "myfit_mdl: setup complete: 0.686000 secs"
## Aggregating results
## Selecting tuning parameters
## Fitting alpha = 0.325, lambda = 0.0333 on full training set
## [1] "myfit_mdl: train complete: 45.991000 secs"
## Warning in myfit_mdl(mdl_specs_lst = myinit_mdl_specs_lst(mdl_specs_lst =
## list(id.prefix = bstMdlIdComponents$family, : model's bestTune found at an
## extreme of tuneGrid for parameter: lambda

##             Length Class      Mode     
## a0             72  -none-     numeric  
## beta        18720  dgCMatrix  S4       
## df             72  -none-     numeric  
## dim             2  -none-     numeric  
## lambda         72  -none-     numeric  
## dev.ratio      72  -none-     numeric  
## nulldev         1  -none-     numeric  
## npasses         1  -none-     numeric  
## jerr            1  -none-     numeric  
## offset          1  -none-     logical  
## classnames      2  -none-     character
## call            5  -none-     call     
## nobs            1  -none-     numeric  
## lambdaOpt       1  -none-     numeric  
## xNames        260  -none-     character
## problemType     1  -none-     character
## tuneValue       2  data.frame list     
## obsLevels       2  -none-     character
## [1] "min lambda > lambdaOpt:"
##                     (Intercept)                   Hhold.fctrMKy 
##                     0.284927345                     0.119272354 
##                   Hhold.fctrPKn                   Hhold.fctrPKy 
##                    -0.541978160                    -0.659345299 
##                   Hhold.fctrSKy                   Income.fctr.Q 
##                    -0.105821337                     0.100955662 
##                   Income.fctr.C                   Income.fctr^6 
##                     0.102746071                    -0.058350533 
##                  Q100562.fctrNo                 Q100689.fctrYes 
##                    -0.120257921                    -0.025994347 
##                 Q101163.fctrDad                 Q102089.fctrOwn 
##                     0.160735509                     0.020752064 
##                 Q104996.fctrYes                 Q105655.fctrYes 
##                    -0.072504900                     0.098132410 
##                  Q106272.fctrNo                 Q106272.fctrYes 
##                    -0.099497687                     0.010039146 
##                 Q106388.fctrYes                  Q106997.fctrGr 
##                     0.022279069                     0.174070813 
##              Q108855.fctrUmm...                Q108855.fctrYes! 
##                    -0.063819781                     0.003789046 
##                  Q109367.fctrNo                 Q109367.fctrYes 
##                     0.076878973                    -0.023983712 
##                  Q110740.fctrPC                  Q112512.fctrNo 
##                     0.062355489                    -0.008754679 
##                  Q113181.fctrNo                 Q113181.fctrYes 
##                    -0.256638975                     0.089322239 
##          Q114386.fctrMysterious                  Q114517.fctrNo 
##                    -0.049677606                    -0.089177737 
##                  Q115390.fctrNo                  Q115611.fctrNo 
##                     0.003587387                    -0.086533053 
##                 Q115611.fctrYes                  Q115899.fctrCs 
##                     0.295161509                    -0.068994241 
##                  Q116601.fctrNo               Q116881.fctrHappy 
##                    -0.053177435                    -0.066789514 
##               Q116881.fctrRight                  Q116953.fctrNo 
##                     0.206032424                     0.054073789 
##      Q117193.fctrStandard hours                  Q118892.fctrNo 
##                     0.034183628                    -0.076177980 
##              Q119650.fctrGiving         Q120194.fctrStudy first 
##                     0.115005528                    -0.005110625 
##                 Q120379.fctrYes             Q120472.fctrScience 
##                    -0.035675231                     0.075405834 
##                 Q122769.fctrYes                  Q122771.fctrPt 
##                     0.028474850                     0.011193207 
##                 Q123621.fctrYes                  Q124742.fctrNo 
##                     0.072433901                    -0.109460808 
##                   Q96024.fctrNo                   Q98197.fctrNo 
##                    -0.010054458                    -0.166700817 
##                   Q98869.fctrNo                   Q99480.fctrNo 
##                    -0.201379948                    -0.198393462 
##                  Q99480.fctrYes                  Q99716.fctrYes 
##                     0.017604588                    -0.081940751 
##  Hhold.fctrSKn:.clusterid.fctr2  Hhold.fctrSKy:.clusterid.fctr3 
##                     0.093618272                    -0.254655380 
##    Hhold.fctrN:.clusterid.fctr4  Hhold.fctrMKy:.clusterid.fctr4 
##                     0.232902682                     0.079966179 
##  Hhold.fctrPKy:.clusterid.fctr4 YOB.Age.fctr(25,30]:YOB.Age.dff 
##                     1.095638283                     0.256139412 
## YOB.Age.fctr(35,40]:YOB.Age.dff YOB.Age.fctr(65,90]:YOB.Age.dff 
##                    -0.711972337                    -0.100447946 
## [1] "max lambda < lambdaOpt:"
##                     (Intercept)                   Hhold.fctrMKy 
##                    2.869882e-01                    1.238080e-01 
##                   Hhold.fctrPKn                   Hhold.fctrPKy 
##                   -5.658864e-01                   -7.334346e-01 
##                   Hhold.fctrSKy                   Income.fctr.Q 
##                   -1.190002e-01                    1.097084e-01 
##                   Income.fctr.C                   Income.fctr^6 
##                    1.195921e-01                   -6.933467e-02 
##                  Q100562.fctrNo                 Q100689.fctrYes 
##                   -1.291741e-01                   -3.807363e-02 
##                 Q101163.fctrDad                 Q102089.fctrOwn 
##                    1.680902e-01                    2.947707e-02 
##                 Q104996.fctrYes                 Q105655.fctrYes 
##                   -8.390703e-02                    1.053847e-01 
##                  Q106272.fctrNo                 Q106272.fctrYes 
##                   -1.065513e-01                    1.210340e-02 
##                 Q106388.fctrYes                  Q106997.fctrGr 
##                    2.737495e-02                    1.839456e-01 
##                  Q106997.fctrYy              Q108855.fctrUmm... 
##                   -6.655299e-03                   -7.288273e-02 
##                Q108855.fctrYes!                  Q109367.fctrNo 
##                    3.086192e-03                    8.388669e-02 
##                 Q109367.fctrYes                  Q110740.fctrPC 
##                   -2.518669e-02                    6.844294e-02 
##                  Q112512.fctrNo                  Q113181.fctrNo 
##                   -2.052338e-02                   -2.613175e-01 
##                 Q113181.fctrYes          Q114386.fctrMysterious 
##                    8.659292e-02                   -6.083107e-02 
##                  Q114517.fctrNo                  Q115390.fctrNo 
##                   -1.002576e-01                    1.219109e-02 
##                  Q115611.fctrNo                 Q115611.fctrYes 
##                   -8.394652e-02                    3.036817e-01 
##                  Q115899.fctrCs                Q116197.fctrA.M. 
##                   -7.788031e-02                    4.033698e-03 
##                  Q116601.fctrNo               Q116881.fctrHappy 
##                   -6.510834e-02                   -7.328888e-02 
##               Q116881.fctrRight                  Q116953.fctrNo 
##                    2.099052e-01                    6.213052e-02 
##      Q117193.fctrStandard hours                 Q118233.fctrYes 
##                    4.433145e-02                   -4.370050e-05 
##                  Q118892.fctrNo              Q119650.fctrGiving 
##                   -8.873265e-02                    1.259459e-01 
##         Q120194.fctrStudy first                 Q120379.fctrYes 
##                   -1.296647e-02                   -4.853490e-02 
##             Q120472.fctrScience                 Q122120.fctrYes 
##                    8.639695e-02                    8.588776e-03 
##                 Q122769.fctrYes                  Q122771.fctrPt 
##                    3.581173e-02                    2.050404e-02 
##                 Q123464.fctrYes                 Q123621.fctrYes 
##                    2.693998e-02                    7.735505e-02 
##                  Q124742.fctrNo                   Q96024.fctrNo 
##                   -1.201438e-01                   -1.438883e-02 
##                  Q98059.fctrYes                   Q98197.fctrNo 
##                   -1.841926e-06                   -1.709835e-01 
##                   Q98869.fctrNo                   Q99480.fctrNo 
##                   -2.089005e-01                   -2.030808e-01 
##                  Q99480.fctrYes                  Q99716.fctrYes 
##                    2.361771e-02                   -9.427593e-02 
##  Hhold.fctrPKy:.clusterid.fctr2  Hhold.fctrSKn:.clusterid.fctr2 
##                   -9.627428e-03                    1.050616e-01 
##  Hhold.fctrSKy:.clusterid.fctr3    Hhold.fctrN:.clusterid.fctr4 
##                   -2.931047e-01                    2.776786e-01 
##  Hhold.fctrMKy:.clusterid.fctr4  Hhold.fctrPKy:.clusterid.fctr4 
##                    9.287322e-02                    1.298769e+00 
## YOB.Age.fctr(25,30]:YOB.Age.dff YOB.Age.fctr(35,40]:YOB.Age.dff 
##                    3.475568e-01                   -8.185835e-01 
## YOB.Age.fctr(65,90]:YOB.Age.dff 
##                   -2.706222e-01 
## [1] "myfit_mdl: train diagnostics complete: 46.645000 secs"

##          Prediction
## Reference   D   R
##         D 332 492
##         R 173 960
##       Accuracy          Kappa  AccuracyLower  AccuracyUpper   AccuracyNull 
##   6.601942e-01   2.641663e-01   6.387259e-01   6.811813e-01   5.789474e-01 
## AccuracyPValue  McnemarPValue 
##   1.087820e-13   6.128653e-35

##          Prediction
## Reference   D   R
##         D  45 169
##         R  38 250
##       Accuracy          Kappa  AccuracyLower  AccuracyUpper   AccuracyNull 
##   5.876494e-01   8.502245e-02   5.431804e-01   6.310801e-01   5.737052e-01 
## AccuracyPValue  McnemarPValue 
##   2.792382e-01   1.630685e-19 
## [1] "myfit_mdl: predict complete: 56.725000 secs"
##                            id
## 1 All.X#YeoJohnson#rcv#glmnet
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           feats
## 1 Q115611.fctr,Q113181.fctr,Q98197.fctr,Q116881.fctr,Q108855.fctr,Q106272.fctr,Q122771.fctr,Q123621.fctr,Q106388.fctr,Q110740.fctr,Q122769.fctr,Q120472.fctr,Q101596.fctr,Q119334.fctr,Q114152.fctr,Q98869.fctr,Q115899.fctr,Q116797.fctr,Q118232.fctr,Gender.fctr,Q105655.fctr,Q99480.fctr,Q123464.fctr,Q120650.fctr,Q122120.fctr,Q107869.fctr,Q120014.fctr,Q102289.fctr,Income.fctr,Q122770.fctr,Q111580.fctr,Q116601.fctr,Q117186.fctr,Q106993.fctr,Q112270.fctr,Q101162.fctr,Q108856.fctr,Q117193.fctr,Q116441.fctr,Q119851.fctr,Q111848.fctr,Q98578.fctr,Q118892.fctr,Q114386.fctr,Q120978.fctr,Q112512.fctr,Q102674.fctr,Q96024.fctr,Q108950.fctr,Q115610.fctr,YOB.Age.fctr,Q112478.fctr,Q116197.fctr,Q124742.fctr,Q106389.fctr,Edn.fctr,Q118117.fctr,Q100562.fctr,Q107491.fctr,Q116448.fctr,Q108754.fctr,Q116953.fctr,Q115602.fctr,Q118233.fctr,Q120012.fctr,Q118237.fctr,Q99581.fctr,.rnorm,Q120194.fctr,Q115777.fctr,Q106997.fctr,Q100680.fctr,Q113584.fctr,Q108343.fctr,Q121700.fctr,Q105840.fctr,Q120379.fctr,Q103293.fctr,Q124122.fctr,Q109367.fctr,Q113992.fctr,Q121699.fctr,Q121011.fctr,Q114748.fctr,Q106042.fctr,Q111220.fctr,Q114517.fctr,Q102687.fctr,Q102906.fctr,Q98078.fctr,Q115390.fctr,Q102089.fctr,Q100010.fctr,Q99982.fctr,Q113583.fctr,Q108342.fctr,Q104996.fctr,Q119650.fctr,Q100689.fctr,Q108617.fctr,Q115195.fctr,Q99716.fctr,Q101163.fctr,Q98059.fctr,Q114961.fctr,Hhold.fctr,Hhold.fctr:.clusterid.fctr,YOB.Age.fctr:YOB.Age.dff
##   max.nTuningRuns min.elapsedtime.everything min.elapsedtime.final
## 1              25                     45.222                 2.802
##   max.AUCpROC.fit max.Sens.fit max.Spec.fit max.AUCROCR.fit
## 1       0.6251103    0.4029126     0.847308       0.6996691
##   opt.prob.threshold.fit max.f.score.fit max.Accuracy.fit
## 1                    0.5       0.7427466        0.6109767
##   max.AccuracyLower.fit max.AccuracyUpper.fit max.Kappa.fit
## 1             0.6387259             0.6811813     0.1605919
##   max.AUCpROC.OOB max.Sens.OOB max.Spec.OOB max.AUCROCR.OOB
## 1        0.555442    0.3504673    0.7604167       0.5696554
##   opt.prob.threshold.OOB max.f.score.OOB max.Accuracy.OOB
## 1                   0.45       0.7072136        0.5876494
##   max.AccuracyLower.OOB max.AccuracyUpper.OOB max.Kappa.OOB
## 1             0.5431804             0.6310801    0.08502245
##   max.AccuracySD.fit max.KappaSD.fit
## 1         0.01175425      0.02458174
## [1] "myfit_mdl: exit: 57.035000 secs"
## [1] "myfit_mdl: enter: 0.001000 secs"
## [1] "myfit_mdl: fitting model: All.X#expoTrans#rcv#glmnet"
## [1] "    indepVar: Q115611.fctr,Q113181.fctr,Q98197.fctr,Q116881.fctr,Q108855.fctr,Q106272.fctr,Q122771.fctr,Q123621.fctr,Q106388.fctr,Q110740.fctr,Q122769.fctr,Q120472.fctr,Q101596.fctr,Q119334.fctr,Q114152.fctr,Q98869.fctr,Q115899.fctr,Q116797.fctr,Q118232.fctr,Gender.fctr,Q105655.fctr,Q99480.fctr,Q123464.fctr,Q120650.fctr,Q122120.fctr,Q107869.fctr,Q120014.fctr,Q102289.fctr,Income.fctr,Q122770.fctr,Q111580.fctr,Q116601.fctr,Q117186.fctr,Q106993.fctr,Q112270.fctr,Q101162.fctr,Q108856.fctr,Q117193.fctr,Q116441.fctr,Q119851.fctr,Q111848.fctr,Q98578.fctr,Q118892.fctr,Q114386.fctr,Q120978.fctr,Q112512.fctr,Q102674.fctr,Q96024.fctr,Q108950.fctr,Q115610.fctr,YOB.Age.fctr,Q112478.fctr,Q116197.fctr,Q124742.fctr,Q106389.fctr,Edn.fctr,Q118117.fctr,Q100562.fctr,Q107491.fctr,Q116448.fctr,Q108754.fctr,Q116953.fctr,Q115602.fctr,Q118233.fctr,Q120012.fctr,Q118237.fctr,Q99581.fctr,.rnorm,Q120194.fctr,Q115777.fctr,Q106997.fctr,Q100680.fctr,Q113584.fctr,Q108343.fctr,Q121700.fctr,Q105840.fctr,Q120379.fctr,Q103293.fctr,Q124122.fctr,Q109367.fctr,Q113992.fctr,Q121699.fctr,Q121011.fctr,Q114748.fctr,Q106042.fctr,Q111220.fctr,Q114517.fctr,Q102687.fctr,Q102906.fctr,Q98078.fctr,Q115390.fctr,Q102089.fctr,Q100010.fctr,Q99982.fctr,Q113583.fctr,Q108342.fctr,Q104996.fctr,Q119650.fctr,Q100689.fctr,Q108617.fctr,Q115195.fctr,Q99716.fctr,Q101163.fctr,Q98059.fctr,Q114961.fctr,Hhold.fctr,Hhold.fctr:.clusterid.fctr,YOB.Age.fctr:YOB.Age.dff"
## [1] "myfit_mdl: setup complete: 0.684000 secs"
## Aggregating results
## Selecting tuning parameters
## Fitting alpha = 0.325, lambda = 0.0333 on full training set
## [1] "myfit_mdl: train complete: 51.916000 secs"
## Warning in myfit_mdl(mdl_specs_lst = myinit_mdl_specs_lst(mdl_specs_lst =
## list(id.prefix = bstMdlIdComponents$family, : model's bestTune found at an
## extreme of tuneGrid for parameter: lambda

##             Length Class      Mode     
## a0             78  -none-     numeric  
## beta        20280  dgCMatrix  S4       
## df             78  -none-     numeric  
## dim             2  -none-     numeric  
## lambda         78  -none-     numeric  
## dev.ratio      78  -none-     numeric  
## nulldev         1  -none-     numeric  
## npasses         1  -none-     numeric  
## jerr            1  -none-     numeric  
## offset          1  -none-     logical  
## classnames      2  -none-     character
## call            5  -none-     call     
## nobs            1  -none-     numeric  
## lambdaOpt       1  -none-     numeric  
## xNames        260  -none-     character
## problemType     1  -none-     character
## tuneValue       2  data.frame list     
## obsLevels       2  -none-     character
## [1] "min lambda > lambdaOpt:"
##                     (Intercept)                   Hhold.fctrMKy 
##                    0.2841057914                    0.1193123419 
##                   Hhold.fctrPKn                   Hhold.fctrPKy 
##                   -0.5419855285                   -0.6593516732 
##                   Hhold.fctrSKy                   Income.fctr.Q 
##                   -0.1058255161                    0.1011437818 
##                   Income.fctr.C                   Income.fctr^6 
##                    0.1025918337                   -0.0589454609 
##                  Q100562.fctrNo                 Q100689.fctrYes 
##                   -0.1207153114                   -0.0260094379 
##                 Q101163.fctrDad                 Q102089.fctrOwn 
##                    0.1607740041                    0.0207063433 
##                 Q104996.fctrYes                 Q105655.fctrYes 
##                   -0.0725469025                    0.0983156982 
##                  Q106272.fctrNo                 Q106272.fctrYes 
##                   -0.0994253553                    0.0099448131 
##                 Q106388.fctrYes                  Q106997.fctrGr 
##                    0.0223568594                    0.1740218958 
##                  Q106997.fctrYy              Q108855.fctrUmm... 
##                   -0.0001090684                   -0.0637276800 
##                Q108855.fctrYes!                  Q109367.fctrNo 
##                    0.0039200713                    0.0768614996 
##                 Q109367.fctrYes                  Q110740.fctrPC 
##                   -0.0240088117                    0.0623116526 
##                  Q112512.fctrNo                  Q113181.fctrNo 
##                   -0.0088673308                   -0.2565048866 
##                 Q113181.fctrYes          Q114386.fctrMysterious 
##                    0.0893498023                   -0.0495496925 
##                  Q114517.fctrNo                  Q115390.fctrNo 
##                   -0.0890981420                    0.0036314089 
##                  Q115611.fctrNo                 Q115611.fctrYes 
##                   -0.0869267830                    0.2948002245 
##                  Q115899.fctrCs                  Q116601.fctrNo 
##                   -0.0689354439                   -0.0530821269 
##               Q116881.fctrHappy               Q116881.fctrRight 
##                   -0.0667045782                    0.2061025675 
##                  Q116953.fctrNo      Q117193.fctrStandard hours 
##                    0.0540600979                    0.0342516834 
##                  Q118892.fctrNo              Q119650.fctrGiving 
##                   -0.0761324315                    0.1149379921 
##         Q120194.fctrStudy first                 Q120379.fctrYes 
##                   -0.0050941795                   -0.0355275668 
##             Q120472.fctrScience                 Q122769.fctrYes 
##                    0.0753506114                    0.0284281170 
##                  Q122771.fctrPt                 Q123621.fctrYes 
##                    0.0111313809                    0.0725146576 
##                  Q124742.fctrNo                   Q96024.fctrNo 
##                   -0.1095448086                   -0.0099844887 
##                   Q98197.fctrNo                   Q98869.fctrNo 
##                   -0.1666755762                   -0.2012088433 
##                   Q99480.fctrNo                  Q99480.fctrYes 
##                   -0.1982745942                    0.0175707860 
##                  Q99716.fctrYes  Hhold.fctrSKn:.clusterid.fctr2 
##                   -0.0822700068                    0.0939410343 
##  Hhold.fctrSKy:.clusterid.fctr3    Hhold.fctrN:.clusterid.fctr4 
##                   -0.2546339394                    0.2330197519 
##  Hhold.fctrMKy:.clusterid.fctr4  Hhold.fctrPKy:.clusterid.fctr4 
##                    0.0800245288                    1.0953376134 
## YOB.Age.fctr(25,30]:YOB.Age.dff YOB.Age.fctr(35,40]:YOB.Age.dff 
##                    0.1104720767                   -0.3073477003 
## YOB.Age.fctr(65,90]:YOB.Age.dff 
##                   -0.0165829269 
## [1] "max lambda < lambdaOpt:"
##                     (Intercept)                   Hhold.fctrMKy 
##                     0.286099539                     0.123866450 
##                   Hhold.fctrPKn                   Hhold.fctrPKy 
##                    -0.565907791                    -0.733229779 
##                   Hhold.fctrSKy                   Income.fctr.Q 
##                    -0.118975950                     0.109961892 
##                   Income.fctr.C                   Income.fctr^6 
##                     0.119436048                    -0.069922780 
##                  Q100562.fctrNo                 Q100689.fctrYes 
##                    -0.129638771                    -0.038066401 
##                 Q101163.fctrDad                 Q102089.fctrOwn 
##                     0.168120680                     0.029438619 
##                 Q104996.fctrYes                 Q105655.fctrYes 
##                    -0.083956148                     0.105571385 
##                  Q106272.fctrNo                 Q106272.fctrYes 
##                    -0.106503777                     0.011986175 
##                 Q106388.fctrYes                  Q106997.fctrGr 
##                     0.027443429                     0.183915354 
##                  Q106997.fctrYy              Q108855.fctrUmm... 
##                    -0.006769732                    -0.072812376 
##                Q108855.fctrYes!                  Q109367.fctrNo 
##                     0.003223047                     0.083838223 
##                 Q109367.fctrYes                  Q110740.fctrPC 
##                    -0.025208887                     0.068401874 
##                  Q112512.fctrNo                  Q113181.fctrNo 
##                    -0.020616649                    -0.261338314 
##                 Q113181.fctrYes          Q114386.fctrMysterious 
##                     0.086438169                    -0.060692532 
##                  Q114517.fctrNo                  Q115390.fctrNo 
##                    -0.100200442                     0.012224968 
##                  Q115611.fctrNo                 Q115611.fctrYes 
##                    -0.084025537                     0.303586230 
##                  Q115899.fctrCs                Q116197.fctrA.M. 
##                    -0.077836087                     0.003834848 
##                  Q116601.fctrNo               Q116881.fctrHappy 
##                    -0.065025411                    -0.073288569 
##               Q116881.fctrRight                  Q116953.fctrNo 
##                     0.209927052                     0.062117366 
##      Q117193.fctrStandard hours                  Q118892.fctrNo 
##                     0.044421041                    -0.088697392 
##              Q119650.fctrGiving         Q120194.fctrStudy first 
##                     0.125868938                    -0.012947160 
##                 Q120379.fctrYes             Q120472.fctrScience 
##                    -0.048381410                     0.086353581 
##                 Q122120.fctrYes                 Q122769.fctrYes 
##                     0.008665692                     0.035757162 
##                  Q122771.fctrPt                 Q123464.fctrYes 
##                     0.020400870                     0.027188248 
##                 Q123621.fctrYes                  Q124742.fctrNo 
##                     0.077460675                    -0.120231088 
##                   Q96024.fctrNo                   Q98197.fctrNo 
##                    -0.014317076                    -0.170968548 
##                   Q98869.fctrNo                   Q99480.fctrNo 
##                    -0.208737179                    -0.202912835 
##                  Q99480.fctrYes                  Q99716.fctrYes 
##                     0.023597972                    -0.094612667 
##  Hhold.fctrPKy:.clusterid.fctr2  Hhold.fctrSKn:.clusterid.fctr2 
##                    -0.010338466                     0.105430108 
##  Hhold.fctrSKy:.clusterid.fctr3    Hhold.fctrN:.clusterid.fctr4 
##                    -0.293205828                     0.277748048 
##  Hhold.fctrMKy:.clusterid.fctr4  Hhold.fctrPKy:.clusterid.fctr4 
##                     0.092981303                     1.298291258 
## YOB.Age.fctr(25,30]:YOB.Age.dff YOB.Age.fctr(35,40]:YOB.Age.dff 
##                     0.149359813                    -0.353675713 
## YOB.Age.fctr(65,90]:YOB.Age.dff 
##                    -0.063677920 
## [1] "myfit_mdl: train diagnostics complete: 52.604000 secs"

##          Prediction
## Reference   D   R
##         D 457 367
##         R 298 835
##       Accuracy          Kappa  AccuracyLower  AccuracyUpper   AccuracyNull 
##   6.601942e-01   2.949612e-01   6.387259e-01   6.811813e-01   5.789474e-01 
## AccuracyPValue  McnemarPValue 
##   1.087820e-13   8.366086e-03

##          Prediction
## Reference   D   R
##         D  45 169
##         R  36 252
##       Accuracy          Kappa  AccuracyLower  AccuracyUpper   AccuracyNull 
##   5.916335e-01   9.268043e-02   5.472040e-01   6.349773e-01   5.737052e-01 
## AccuracyPValue  McnemarPValue 
##   2.217899e-01   2.991021e-20 
## [1] "myfit_mdl: predict complete: 62.517000 secs"
##                           id
## 1 All.X#expoTrans#rcv#glmnet
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           feats
## 1 Q115611.fctr,Q113181.fctr,Q98197.fctr,Q116881.fctr,Q108855.fctr,Q106272.fctr,Q122771.fctr,Q123621.fctr,Q106388.fctr,Q110740.fctr,Q122769.fctr,Q120472.fctr,Q101596.fctr,Q119334.fctr,Q114152.fctr,Q98869.fctr,Q115899.fctr,Q116797.fctr,Q118232.fctr,Gender.fctr,Q105655.fctr,Q99480.fctr,Q123464.fctr,Q120650.fctr,Q122120.fctr,Q107869.fctr,Q120014.fctr,Q102289.fctr,Income.fctr,Q122770.fctr,Q111580.fctr,Q116601.fctr,Q117186.fctr,Q106993.fctr,Q112270.fctr,Q101162.fctr,Q108856.fctr,Q117193.fctr,Q116441.fctr,Q119851.fctr,Q111848.fctr,Q98578.fctr,Q118892.fctr,Q114386.fctr,Q120978.fctr,Q112512.fctr,Q102674.fctr,Q96024.fctr,Q108950.fctr,Q115610.fctr,YOB.Age.fctr,Q112478.fctr,Q116197.fctr,Q124742.fctr,Q106389.fctr,Edn.fctr,Q118117.fctr,Q100562.fctr,Q107491.fctr,Q116448.fctr,Q108754.fctr,Q116953.fctr,Q115602.fctr,Q118233.fctr,Q120012.fctr,Q118237.fctr,Q99581.fctr,.rnorm,Q120194.fctr,Q115777.fctr,Q106997.fctr,Q100680.fctr,Q113584.fctr,Q108343.fctr,Q121700.fctr,Q105840.fctr,Q120379.fctr,Q103293.fctr,Q124122.fctr,Q109367.fctr,Q113992.fctr,Q121699.fctr,Q121011.fctr,Q114748.fctr,Q106042.fctr,Q111220.fctr,Q114517.fctr,Q102687.fctr,Q102906.fctr,Q98078.fctr,Q115390.fctr,Q102089.fctr,Q100010.fctr,Q99982.fctr,Q113583.fctr,Q108342.fctr,Q104996.fctr,Q119650.fctr,Q100689.fctr,Q108617.fctr,Q115195.fctr,Q99716.fctr,Q101163.fctr,Q98059.fctr,Q114961.fctr,Hhold.fctr,Hhold.fctr:.clusterid.fctr,YOB.Age.fctr:YOB.Age.dff
##   max.nTuningRuns min.elapsedtime.everything min.elapsedtime.final
## 1              25                     51.149                  2.38
##   max.AUCpROC.fit max.Sens.fit max.Spec.fit max.AUCROCR.fit
## 1       0.6240622     0.401699    0.8464254       0.6995974
##   opt.prob.threshold.fit max.f.score.fit max.Accuracy.fit
## 1                   0.55       0.7152034        0.6109764
##   max.AccuracyLower.fit max.AccuracyUpper.fit max.Kappa.fit
## 1             0.6387259             0.6811813     0.1605916
##   max.AUCpROC.OOB max.Sens.OOB max.Spec.OOB max.AUCROCR.OOB
## 1        0.555442    0.3504673    0.7604167        0.569704
##   opt.prob.threshold.OOB max.f.score.OOB max.Accuracy.OOB
## 1                   0.45       0.7108604        0.5916335
##   max.AccuracyLower.OOB max.AccuracyUpper.OOB max.Kappa.OOB
## 1              0.547204             0.6349773    0.09268043
##   max.AccuracySD.fit max.KappaSD.fit
## 1         0.01133176      0.02359669
## [1] "myfit_mdl: exit: 62.835000 secs"
## [1] "myfit_mdl: enter: 0.000000 secs"
## [1] "myfit_mdl: fitting model: All.X#center#rcv#glmnet"
## [1] "    indepVar: Q115611.fctr,Q113181.fctr,Q98197.fctr,Q116881.fctr,Q108855.fctr,Q106272.fctr,Q122771.fctr,Q123621.fctr,Q106388.fctr,Q110740.fctr,Q122769.fctr,Q120472.fctr,Q101596.fctr,Q119334.fctr,Q114152.fctr,Q98869.fctr,Q115899.fctr,Q116797.fctr,Q118232.fctr,Gender.fctr,Q105655.fctr,Q99480.fctr,Q123464.fctr,Q120650.fctr,Q122120.fctr,Q107869.fctr,Q120014.fctr,Q102289.fctr,Income.fctr,Q122770.fctr,Q111580.fctr,Q116601.fctr,Q117186.fctr,Q106993.fctr,Q112270.fctr,Q101162.fctr,Q108856.fctr,Q117193.fctr,Q116441.fctr,Q119851.fctr,Q111848.fctr,Q98578.fctr,Q118892.fctr,Q114386.fctr,Q120978.fctr,Q112512.fctr,Q102674.fctr,Q96024.fctr,Q108950.fctr,Q115610.fctr,YOB.Age.fctr,Q112478.fctr,Q116197.fctr,Q124742.fctr,Q106389.fctr,Edn.fctr,Q118117.fctr,Q100562.fctr,Q107491.fctr,Q116448.fctr,Q108754.fctr,Q116953.fctr,Q115602.fctr,Q118233.fctr,Q120012.fctr,Q118237.fctr,Q99581.fctr,.rnorm,Q120194.fctr,Q115777.fctr,Q106997.fctr,Q100680.fctr,Q113584.fctr,Q108343.fctr,Q121700.fctr,Q105840.fctr,Q120379.fctr,Q103293.fctr,Q124122.fctr,Q109367.fctr,Q113992.fctr,Q121699.fctr,Q121011.fctr,Q114748.fctr,Q106042.fctr,Q111220.fctr,Q114517.fctr,Q102687.fctr,Q102906.fctr,Q98078.fctr,Q115390.fctr,Q102089.fctr,Q100010.fctr,Q99982.fctr,Q113583.fctr,Q108342.fctr,Q104996.fctr,Q119650.fctr,Q100689.fctr,Q108617.fctr,Q115195.fctr,Q99716.fctr,Q101163.fctr,Q98059.fctr,Q114961.fctr,Hhold.fctr,Hhold.fctr:.clusterid.fctr,YOB.Age.fctr:YOB.Age.dff"
## [1] "myfit_mdl: setup complete: 0.709000 secs"
## Aggregating results
## Selecting tuning parameters
## Fitting alpha = 0.325, lambda = 0.0333 on full training set
## [1] "myfit_mdl: train complete: 16.270000 secs"
## Warning in myfit_mdl(mdl_specs_lst = myinit_mdl_specs_lst(mdl_specs_lst =
## list(id.prefix = bstMdlIdComponents$family, : model's bestTune found at an
## extreme of tuneGrid for parameter: lambda

##             Length Class      Mode     
## a0             85  -none-     numeric  
## beta        22100  dgCMatrix  S4       
## df             85  -none-     numeric  
## dim             2  -none-     numeric  
## lambda         85  -none-     numeric  
## dev.ratio      85  -none-     numeric  
## nulldev         1  -none-     numeric  
## npasses         1  -none-     numeric  
## jerr            1  -none-     numeric  
## offset          1  -none-     logical  
## classnames      2  -none-     character
## call            5  -none-     call     
## nobs            1  -none-     numeric  
## lambdaOpt       1  -none-     numeric  
## xNames        260  -none-     character
## problemType     1  -none-     character
## tuneValue       2  data.frame list     
## obsLevels       2  -none-     character
## [1] "min lambda > lambdaOpt:"
##                     (Intercept)                   Hhold.fctrMKy 
##                    0.3353785090                    0.1223388126 
##                   Hhold.fctrPKn                   Hhold.fctrPKy 
##                   -0.5431418661                   -0.6618709561 
##                   Hhold.fctrSKy                   Income.fctr.Q 
##                   -0.1090177325                    0.0980362635 
##                   Income.fctr.C                   Income.fctr^6 
##                    0.1010397569                   -0.0558545740 
##                  Q100562.fctrNo                 Q100689.fctrYes 
##                   -0.1227211571                   -0.0242725337 
##                 Q101163.fctrDad                 Q102089.fctrOwn 
##                    0.1609136964                    0.0213110713 
##                 Q104996.fctrYes                 Q105655.fctrYes 
##                   -0.0733859891                    0.0994923204 
##                  Q106272.fctrNo                 Q106272.fctrYes 
##                   -0.0985282958                    0.0109728198 
##                 Q106388.fctrYes                  Q106997.fctrGr 
##                    0.0222597292                    0.1722153193 
##                  Q106997.fctrYy              Q108855.fctrUmm... 
##                   -0.0005482815                   -0.0640940960 
##                Q108855.fctrYes!                  Q109367.fctrNo 
##                    0.0043637645                    0.0776512027 
##                 Q109367.fctrYes                  Q110740.fctrPC 
##                   -0.0232319681                    0.0617129947 
##                  Q112512.fctrNo                  Q113181.fctrNo 
##                   -0.0089942731                   -0.2565348387 
##                 Q113181.fctrYes          Q114386.fctrMysterious 
##                    0.0883115008                   -0.0488277360 
##                  Q114517.fctrNo                  Q115390.fctrNo 
##                   -0.0891692654                    0.0037303385 
##                  Q115611.fctrNo                 Q115611.fctrYes 
##                   -0.0867549557                    0.2945956632 
##                  Q115899.fctrCs                  Q116601.fctrNo 
##                   -0.0700586145                   -0.0530411889 
##               Q116881.fctrHappy               Q116881.fctrRight 
##                   -0.0660674927                    0.2077280095 
##                  Q116953.fctrNo      Q117193.fctrStandard hours 
##                    0.0531229393                    0.0358169094 
##                  Q118892.fctrNo              Q119650.fctrGiving 
##                   -0.0768159368                    0.1151091086 
##         Q120194.fctrStudy first                 Q120379.fctrYes 
##                   -0.0034275168                   -0.0337302239 
##             Q120472.fctrScience                 Q122769.fctrYes 
##                    0.0750873634                    0.0270370204 
##                  Q122771.fctrPt                 Q123464.fctrYes 
##                    0.0093972520                    0.0018784552 
##                 Q123621.fctrYes                  Q124742.fctrNo 
##                    0.0702491183                   -0.1091270840 
##                   Q96024.fctrNo                   Q98197.fctrNo 
##                   -0.0097694988                   -0.1666944739 
##                   Q98869.fctrNo                   Q99480.fctrNo 
##                   -0.1988235708                   -0.1985567368 
##                  Q99480.fctrYes                  Q99716.fctrYes 
##                    0.0163095000                   -0.0848727311 
##  Hhold.fctrSKn:.clusterid.fctr2  Hhold.fctrSKy:.clusterid.fctr3 
##                    0.0972361315                   -0.2486718925 
##    Hhold.fctrN:.clusterid.fctr4  Hhold.fctrMKy:.clusterid.fctr4 
##                    0.2316323732                    0.0799692788 
##  Hhold.fctrPKy:.clusterid.fctr4 YOB.Age.fctr(25,30]:YOB.Age.dff 
##                    1.0850351271                    0.0174906316 
## YOB.Age.fctr(35,40]:YOB.Age.dff 
##                   -0.0338654783 
## [1] "max lambda < lambdaOpt:"
##                     (Intercept)                   Hhold.fctrMKy 
##                    0.3368045290                    0.1268980348 
##                   Hhold.fctrPKn                   Hhold.fctrPKy 
##                   -0.5667951509                   -0.7360179842 
##                   Hhold.fctrSKy                   Income.fctr.Q 
##                   -0.1223613415                    0.1076270135 
##                   Income.fctr.C                   Income.fctr^6 
##                    0.1181824886                   -0.0677662807 
##                  Q100562.fctrNo                 Q100689.fctrYes 
##                   -0.1336075822                   -0.0361502891 
##                 Q101163.fctrDad                 Q102089.fctrOwn 
##                    0.1686107441                    0.0295085694 
##                 Q104996.fctrYes                 Q105655.fctrYes 
##                   -0.0849702314                    0.1075000884 
##                  Q106272.fctrNo                 Q106272.fctrYes 
##                   -0.1055147182                    0.0127575171 
##                 Q106388.fctrYes                  Q106997.fctrGr 
##                    0.0276876095                    0.1820281443 
##                  Q106997.fctrYy              Q108855.fctrUmm... 
##                   -0.0075273343                   -0.0728898757 
##                Q108855.fctrYes!                  Q109367.fctrNo 
##                    0.0041288338                    0.0844117618 
##                 Q109367.fctrYes                  Q110740.fctrPC 
##                   -0.0244431062                    0.0676957492 
##                  Q112512.fctrNo                  Q113181.fctrNo 
##                   -0.0209172822                   -0.2616295419 
##                 Q113181.fctrYes          Q114386.fctrMysterious 
##                    0.0851082794                   -0.0595585781 
##                  Q114517.fctrNo                  Q115390.fctrNo 
##                   -0.1000702347                    0.0122548916 
##                  Q115611.fctrNo                 Q115611.fctrYes 
##                   -0.0839508900                    0.3033680414 
##                  Q115899.fctrCs                Q116197.fctrA.M. 
##                   -0.0787815553                    0.0025657763 
##                  Q116601.fctrNo               Q116881.fctrHappy 
##                   -0.0643774543                   -0.0725092183 
##               Q116881.fctrRight                  Q116953.fctrNo 
##                    0.2118371133                    0.0609143935 
##      Q117193.fctrStandard hours                 Q118233.fctrYes 
##                    0.0462755734                   -0.0004803217 
##                  Q118892.fctrNo              Q119650.fctrGiving 
##                   -0.0889319734                    0.1258648670 
##         Q120194.fctrStudy first                 Q120379.fctrYes 
##                   -0.0111318453                   -0.0460010967 
##             Q120472.fctrScience                 Q122120.fctrYes 
##                    0.0857212012                    0.0087862652 
##                 Q122769.fctrYes                  Q122771.fctrPt 
##                    0.0340947285                    0.0181767014 
##                 Q123464.fctrYes                 Q123621.fctrYes 
##                    0.0299377349                    0.0757128321 
##                  Q124742.fctrNo                   Q96024.fctrNo 
##                   -0.1201268773                   -0.0136151428 
##                  Q98059.fctrYes                   Q98197.fctrNo 
##                   -0.0008977055                   -0.1704429347 
##                   Q98869.fctrNo                   Q99480.fctrNo 
##                   -0.2057924299                   -0.2024638922 
##                  Q99480.fctrYes                  Q99716.fctrYes 
##                    0.0226409850                   -0.0981662351 
##  Hhold.fctrPKy:.clusterid.fctr2  Hhold.fctrSKn:.clusterid.fctr2 
##                   -0.0058086382                    0.1098872900 
##  Hhold.fctrSKy:.clusterid.fctr3    Hhold.fctrN:.clusterid.fctr4 
##                   -0.2880193501                    0.2766211491 
##  Hhold.fctrMKy:.clusterid.fctr4  Hhold.fctrPKy:.clusterid.fctr4 
##                    0.0932839092                    1.2878098547 
## YOB.Age.fctr(25,30]:YOB.Age.dff YOB.Age.fctr(35,40]:YOB.Age.dff 
##                    0.0216901093                   -0.0381595075 
## [1] "myfit_mdl: train diagnostics complete: 16.923000 secs"

##          Prediction
## Reference   D   R
##         D 461 363
##         R 295 838
##       Accuracy          Kappa  AccuracyLower  AccuracyUpper   AccuracyNull 
##   6.637711e-01   3.024994e-01   6.423517e-01   6.846987e-01   5.789474e-01 
## AccuracyPValue  McnemarPValue 
##   8.843720e-15   9.003218e-03

## [1] "mypredict_mdl: maxMetricDf:"
##    threshold   f.score  accuracy
## 10      0.45 0.7078652 0.5856574
## 11      0.50 0.6780186 0.5856574
##          Prediction
## Reference   D   R
##         D  75 139
##         R  69 219
##       Accuracy          Kappa  AccuracyLower  AccuracyUpper   AccuracyNull 
##   5.856574e-01   1.157481e-01   5.411697e-01   6.291304e-01   5.737052e-01 
## AccuracyPValue  McnemarPValue 
##   3.104270e-01   1.715935e-06 
## [1] "myfit_mdl: predict complete: 26.722000 secs"
##                        id
## 1 All.X#center#rcv#glmnet
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           feats
## 1 Q115611.fctr,Q113181.fctr,Q98197.fctr,Q116881.fctr,Q108855.fctr,Q106272.fctr,Q122771.fctr,Q123621.fctr,Q106388.fctr,Q110740.fctr,Q122769.fctr,Q120472.fctr,Q101596.fctr,Q119334.fctr,Q114152.fctr,Q98869.fctr,Q115899.fctr,Q116797.fctr,Q118232.fctr,Gender.fctr,Q105655.fctr,Q99480.fctr,Q123464.fctr,Q120650.fctr,Q122120.fctr,Q107869.fctr,Q120014.fctr,Q102289.fctr,Income.fctr,Q122770.fctr,Q111580.fctr,Q116601.fctr,Q117186.fctr,Q106993.fctr,Q112270.fctr,Q101162.fctr,Q108856.fctr,Q117193.fctr,Q116441.fctr,Q119851.fctr,Q111848.fctr,Q98578.fctr,Q118892.fctr,Q114386.fctr,Q120978.fctr,Q112512.fctr,Q102674.fctr,Q96024.fctr,Q108950.fctr,Q115610.fctr,YOB.Age.fctr,Q112478.fctr,Q116197.fctr,Q124742.fctr,Q106389.fctr,Edn.fctr,Q118117.fctr,Q100562.fctr,Q107491.fctr,Q116448.fctr,Q108754.fctr,Q116953.fctr,Q115602.fctr,Q118233.fctr,Q120012.fctr,Q118237.fctr,Q99581.fctr,.rnorm,Q120194.fctr,Q115777.fctr,Q106997.fctr,Q100680.fctr,Q113584.fctr,Q108343.fctr,Q121700.fctr,Q105840.fctr,Q120379.fctr,Q103293.fctr,Q124122.fctr,Q109367.fctr,Q113992.fctr,Q121699.fctr,Q121011.fctr,Q114748.fctr,Q106042.fctr,Q111220.fctr,Q114517.fctr,Q102687.fctr,Q102906.fctr,Q98078.fctr,Q115390.fctr,Q102089.fctr,Q100010.fctr,Q99982.fctr,Q113583.fctr,Q108342.fctr,Q104996.fctr,Q119650.fctr,Q100689.fctr,Q108617.fctr,Q115195.fctr,Q99716.fctr,Q101163.fctr,Q98059.fctr,Q114961.fctr,Hhold.fctr,Hhold.fctr:.clusterid.fctr,YOB.Age.fctr:YOB.Age.dff
##   max.nTuningRuns min.elapsedtime.everything min.elapsedtime.final
## 1              25                     15.479                  1.58
##   max.AUCpROC.fit max.Sens.fit max.Spec.fit max.AUCROCR.fit
## 1        0.621966    0.3992718    0.8446602        0.699893
##   opt.prob.threshold.fit max.f.score.fit max.Accuracy.fit
## 1                   0.55       0.7180805        0.6128487
##   max.AccuracyLower.fit max.AccuracyUpper.fit max.Kappa.fit
## 1             0.6423517             0.6846987     0.1649007
##   max.AUCpROC.OOB max.Sens.OOB max.Spec.OOB max.AUCROCR.OOB
## 1        0.555442    0.3504673    0.7604167       0.5688766
##   opt.prob.threshold.OOB max.f.score.OOB max.Accuracy.OOB
## 1                    0.5       0.6780186        0.5856574
##   max.AccuracyLower.OOB max.AccuracyUpper.OOB max.Kappa.OOB
## 1             0.5411697             0.6291304     0.1157481
##   max.AccuracySD.fit max.KappaSD.fit
## 1        0.009997796        0.019356
## [1] "myfit_mdl: exit: 27.056000 secs"
## [1] "myfit_mdl: enter: 0.001000 secs"
## [1] "myfit_mdl: fitting model: All.X#scale#rcv#glmnet"
## [1] "    indepVar: Q115611.fctr,Q113181.fctr,Q98197.fctr,Q116881.fctr,Q108855.fctr,Q106272.fctr,Q122771.fctr,Q123621.fctr,Q106388.fctr,Q110740.fctr,Q122769.fctr,Q120472.fctr,Q101596.fctr,Q119334.fctr,Q114152.fctr,Q98869.fctr,Q115899.fctr,Q116797.fctr,Q118232.fctr,Gender.fctr,Q105655.fctr,Q99480.fctr,Q123464.fctr,Q120650.fctr,Q122120.fctr,Q107869.fctr,Q120014.fctr,Q102289.fctr,Income.fctr,Q122770.fctr,Q111580.fctr,Q116601.fctr,Q117186.fctr,Q106993.fctr,Q112270.fctr,Q101162.fctr,Q108856.fctr,Q117193.fctr,Q116441.fctr,Q119851.fctr,Q111848.fctr,Q98578.fctr,Q118892.fctr,Q114386.fctr,Q120978.fctr,Q112512.fctr,Q102674.fctr,Q96024.fctr,Q108950.fctr,Q115610.fctr,YOB.Age.fctr,Q112478.fctr,Q116197.fctr,Q124742.fctr,Q106389.fctr,Edn.fctr,Q118117.fctr,Q100562.fctr,Q107491.fctr,Q116448.fctr,Q108754.fctr,Q116953.fctr,Q115602.fctr,Q118233.fctr,Q120012.fctr,Q118237.fctr,Q99581.fctr,.rnorm,Q120194.fctr,Q115777.fctr,Q106997.fctr,Q100680.fctr,Q113584.fctr,Q108343.fctr,Q121700.fctr,Q105840.fctr,Q120379.fctr,Q103293.fctr,Q124122.fctr,Q109367.fctr,Q113992.fctr,Q121699.fctr,Q121011.fctr,Q114748.fctr,Q106042.fctr,Q111220.fctr,Q114517.fctr,Q102687.fctr,Q102906.fctr,Q98078.fctr,Q115390.fctr,Q102089.fctr,Q100010.fctr,Q99982.fctr,Q113583.fctr,Q108342.fctr,Q104996.fctr,Q119650.fctr,Q100689.fctr,Q108617.fctr,Q115195.fctr,Q99716.fctr,Q101163.fctr,Q98059.fctr,Q114961.fctr,Hhold.fctr,Hhold.fctr:.clusterid.fctr,YOB.Age.fctr:YOB.Age.dff"
## [1] "myfit_mdl: setup complete: 0.673000 secs"
## Warning in preProcess.default(method = "scale", x =
## structure(c(-0.480112420809766, : These variables have zero variances:
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff
## Aggregating results
## Selecting tuning parameters
## Fitting alpha = 0.325, lambda = 0.0333 on full training set
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "scale", x
## = structure(c(-0.480112420809766, : These variables have zero variances:
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff

## [1] "myfit_mdl: train complete: 15.588000 secs"
## Warning in myfit_mdl(mdl_specs_lst = myinit_mdl_specs_lst(mdl_specs_lst =
## list(id.prefix = bstMdlIdComponents$family, : model's bestTune found at an
## extreme of tuneGrid for parameter: lambda

##             Length Class      Mode     
## a0             85  -none-     numeric  
## beta        22100  dgCMatrix  S4       
## df             85  -none-     numeric  
## dim             2  -none-     numeric  
## lambda         85  -none-     numeric  
## dev.ratio      85  -none-     numeric  
## nulldev         1  -none-     numeric  
## npasses         1  -none-     numeric  
## jerr            1  -none-     numeric  
## offset          1  -none-     logical  
## classnames      2  -none-     character
## call            5  -none-     call     
## nobs            1  -none-     numeric  
## lambdaOpt       1  -none-     numeric  
## xNames        260  -none-     character
## problemType     1  -none-     character
## tuneValue       2  data.frame list     
## obsLevels       2  -none-     character
## [1] "min lambda > lambdaOpt:"
##                     (Intercept)                   Hhold.fctrMKy 
##                    0.2689370104                    0.0582685657 
##                   Hhold.fctrPKn                   Hhold.fctrPKy 
##                   -0.0857222952                   -0.0557948230 
##                   Hhold.fctrSKy                   Income.fctr.Q 
##                   -0.0189496586                    0.0375248761 
##                   Income.fctr.C                   Income.fctr^6 
##                    0.0378139429                   -0.0214429930 
##                  Q100562.fctrNo                 Q100689.fctrYes 
##                   -0.0453982312                   -0.0121334702 
##                 Q101163.fctrDad                 Q102089.fctrOwn 
##                    0.0804768974                    0.0104433630 
##                 Q104996.fctrYes                 Q105655.fctrYes 
##                   -0.0363894639                    0.0497457184 
##                  Q106272.fctrNo                 Q106272.fctrYes 
##                   -0.0411765569                    0.0052928490 
##                 Q106388.fctrYes                  Q106997.fctrGr 
##                    0.0095044705                    0.0859423441 
##                  Q106997.fctrYy              Q108855.fctrUmm... 
##                   -0.0002684511                   -0.0304420846 
##                Q108855.fctrYes!                  Q109367.fctrNo 
##                    0.0021809210                    0.0379086758 
##                 Q109367.fctrYes                  Q110740.fctrPC 
##                   -0.0115562742                    0.0308013595 
##                  Q112512.fctrNo                  Q113181.fctrNo 
##                   -0.0033188626                   -0.1279277954 
##                 Q113181.fctrYes          Q114386.fctrMysterious 
##                    0.0430621139                   -0.0244124521 
##                  Q114517.fctrNo                  Q115390.fctrNo 
##                   -0.0440510918                    0.0017532494 
##                  Q115611.fctrNo                 Q115611.fctrYes 
##                   -0.0433714261                    0.1414192000 
##                  Q115899.fctrCs                  Q116601.fctrNo 
##                   -0.0329012272                   -0.0186047389 
##               Q116881.fctrHappy               Q116881.fctrRight 
##                   -0.0328458949                    0.0881059093 
##                  Q116953.fctrNo      Q117193.fctrStandard hours 
##                    0.0232803894                    0.0178105863 
##                  Q118892.fctrNo              Q119650.fctrGiving 
##                   -0.0366364805                    0.0558624455 
##         Q120194.fctrStudy first                 Q120379.fctrYes 
##                   -0.0017053109                   -0.0158780334 
##             Q120472.fctrScience                 Q122769.fctrYes 
##                    0.0369922916                    0.0123436296 
##                  Q122771.fctrPt                 Q123464.fctrYes 
##                    0.0033537563                    0.0003808286 
##                 Q123621.fctrYes                  Q124742.fctrNo 
##                    0.0343880652                   -0.0521513512 
##                   Q96024.fctrNo                   Q98197.fctrNo 
##                   -0.0044886901                   -0.0831066391 
##                   Q98869.fctrNo                   Q99480.fctrNo 
##                   -0.0706569408                   -0.0732669015 
##                  Q99480.fctrYes                  Q99716.fctrYes 
##                    0.0076123789                   -0.0229261739 
##  Hhold.fctrSKn:.clusterid.fctr2  Hhold.fctrSKy:.clusterid.fctr3 
##                    0.0340559799                   -0.0209627029 
##    Hhold.fctrN:.clusterid.fctr4  Hhold.fctrMKy:.clusterid.fctr4 
##                    0.0233023235                    0.0208175684 
##  Hhold.fctrPKy:.clusterid.fctr4 YOB.Age.fctr(25,30]:YOB.Age.dff 
##                    0.0346778640                    0.0193079561 
## YOB.Age.fctr(35,40]:YOB.Age.dff 
##                   -0.0346153145 
## [1] "max lambda < lambdaOpt:"
##                     (Intercept)                   Hhold.fctrMKy 
##                    0.2687574078                    0.0604400706 
##                   Hhold.fctrPKn                   Hhold.fctrPKy 
##                   -0.0894554154                   -0.0620453168 
##                   Hhold.fctrSKy                   Income.fctr.Q 
##                   -0.0212690688                    0.0411958821 
##                   Income.fctr.C                   Income.fctr^6 
##                    0.0442295787                   -0.0260159873 
##                  Q100562.fctrNo                 Q100689.fctrYes 
##                   -0.0494254458                   -0.0180709793 
##                 Q101163.fctrDad                 Q102089.fctrOwn 
##                    0.0843263803                    0.0144604979 
##                 Q104996.fctrYes                 Q105655.fctrYes 
##                   -0.0421336716                    0.0537495668 
##                  Q106272.fctrNo                 Q106272.fctrYes 
##                   -0.0440962950                    0.0061537156 
##                 Q106388.fctrYes                  Q106997.fctrGr 
##                    0.0118220695                    0.0908393370 
##                  Q106997.fctrYy              Q108855.fctrUmm... 
##                   -0.0036855537                   -0.0346197217 
##                Q108855.fctrYes!                  Q109367.fctrNo 
##                    0.0020635074                    0.0412091249 
##                 Q109367.fctrYes                  Q110740.fctrPC 
##                   -0.0121587305                    0.0337873914 
##                  Q112512.fctrNo                  Q113181.fctrNo 
##                   -0.0077184208                   -0.1304684021 
##                 Q113181.fctrYes          Q114386.fctrMysterious 
##                    0.0415001715                   -0.0297775619 
##                  Q114517.fctrNo                  Q115390.fctrNo 
##                   -0.0494363509                    0.0057597672 
##                  Q115611.fctrNo                 Q115611.fctrYes 
##                   -0.0419695889                    0.1456303371 
##                  Q115899.fctrCs                Q116197.fctrA.M. 
##                   -0.0369977321                    0.0011445068 
##                  Q116601.fctrNo               Q116881.fctrHappy 
##                   -0.0225810498                   -0.0360484418 
##               Q116881.fctrRight                  Q116953.fctrNo 
##                    0.0898487476                    0.0266948858 
##      Q117193.fctrStandard hours                 Q118233.fctrYes 
##                    0.0230113403                   -0.0002013763 
##                  Q118892.fctrNo              Q119650.fctrGiving 
##                   -0.0424150852                    0.0610822146 
##         Q120194.fctrStudy first                 Q120379.fctrYes 
##                   -0.0055384870                   -0.0216543760 
##             Q120472.fctrScience                 Q122120.fctrYes 
##                    0.0422311228                    0.0034867935 
##                 Q122769.fctrYes                  Q122771.fctrPt 
##                    0.0155657944                    0.0064870270 
##                 Q123464.fctrYes                 Q123621.fctrYes 
##                    0.0060694262                    0.0370626403 
##                  Q124742.fctrNo                   Q96024.fctrNo 
##                   -0.0574081038                   -0.0062556082 
##                  Q98059.fctrYes                   Q98197.fctrNo 
##                   -0.0003727267                   -0.0849754591 
##                   Q98869.fctrNo                   Q99480.fctrNo 
##                   -0.0731334996                   -0.0747086313 
##                  Q99480.fctrYes                  Q99716.fctrYes 
##                    0.0105675685                   -0.0265170703 
##  Hhold.fctrPKy:.clusterid.fctr2  Hhold.fctrSKn:.clusterid.fctr2 
##                   -0.0001313043                    0.0384869213 
##  Hhold.fctrSKy:.clusterid.fctr3    Hhold.fctrN:.clusterid.fctr4 
##                   -0.0242796402                    0.0278282151 
##  Hhold.fctrMKy:.clusterid.fctr4  Hhold.fctrPKy:.clusterid.fctr4 
##                    0.0242836273                    0.0411585707 
## YOB.Age.fctr(25,30]:YOB.Age.dff YOB.Age.fctr(35,40]:YOB.Age.dff 
##                    0.0239437711                   -0.0390044204 
## [1] "myfit_mdl: train diagnostics complete: 16.257000 secs"

##          Prediction
## Reference   D   R
##         D 461 363
##         R 295 838
##       Accuracy          Kappa  AccuracyLower  AccuracyUpper   AccuracyNull 
##   6.637711e-01   3.024994e-01   6.423517e-01   6.846987e-01   5.789474e-01 
## AccuracyPValue  McnemarPValue 
##   8.843720e-15   9.003218e-03

## [1] "mypredict_mdl: maxMetricDf:"
##    threshold   f.score  accuracy
## 10      0.45 0.7078652 0.5856574
## 11      0.50 0.6780186 0.5856574
##          Prediction
## Reference   D   R
##         D  75 139
##         R  69 219
##       Accuracy          Kappa  AccuracyLower  AccuracyUpper   AccuracyNull 
##   5.856574e-01   1.157481e-01   5.411697e-01   6.291304e-01   5.737052e-01 
## AccuracyPValue  McnemarPValue 
##   3.104270e-01   1.715935e-06 
## [1] "myfit_mdl: predict complete: 25.781000 secs"
##                       id
## 1 All.X#scale#rcv#glmnet
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           feats
## 1 Q115611.fctr,Q113181.fctr,Q98197.fctr,Q116881.fctr,Q108855.fctr,Q106272.fctr,Q122771.fctr,Q123621.fctr,Q106388.fctr,Q110740.fctr,Q122769.fctr,Q120472.fctr,Q101596.fctr,Q119334.fctr,Q114152.fctr,Q98869.fctr,Q115899.fctr,Q116797.fctr,Q118232.fctr,Gender.fctr,Q105655.fctr,Q99480.fctr,Q123464.fctr,Q120650.fctr,Q122120.fctr,Q107869.fctr,Q120014.fctr,Q102289.fctr,Income.fctr,Q122770.fctr,Q111580.fctr,Q116601.fctr,Q117186.fctr,Q106993.fctr,Q112270.fctr,Q101162.fctr,Q108856.fctr,Q117193.fctr,Q116441.fctr,Q119851.fctr,Q111848.fctr,Q98578.fctr,Q118892.fctr,Q114386.fctr,Q120978.fctr,Q112512.fctr,Q102674.fctr,Q96024.fctr,Q108950.fctr,Q115610.fctr,YOB.Age.fctr,Q112478.fctr,Q116197.fctr,Q124742.fctr,Q106389.fctr,Edn.fctr,Q118117.fctr,Q100562.fctr,Q107491.fctr,Q116448.fctr,Q108754.fctr,Q116953.fctr,Q115602.fctr,Q118233.fctr,Q120012.fctr,Q118237.fctr,Q99581.fctr,.rnorm,Q120194.fctr,Q115777.fctr,Q106997.fctr,Q100680.fctr,Q113584.fctr,Q108343.fctr,Q121700.fctr,Q105840.fctr,Q120379.fctr,Q103293.fctr,Q124122.fctr,Q109367.fctr,Q113992.fctr,Q121699.fctr,Q121011.fctr,Q114748.fctr,Q106042.fctr,Q111220.fctr,Q114517.fctr,Q102687.fctr,Q102906.fctr,Q98078.fctr,Q115390.fctr,Q102089.fctr,Q100010.fctr,Q99982.fctr,Q113583.fctr,Q108342.fctr,Q104996.fctr,Q119650.fctr,Q100689.fctr,Q108617.fctr,Q115195.fctr,Q99716.fctr,Q101163.fctr,Q98059.fctr,Q114961.fctr,Hhold.fctr,Hhold.fctr:.clusterid.fctr,YOB.Age.fctr:YOB.Age.dff
##   max.nTuningRuns min.elapsedtime.everything min.elapsedtime.final
## 1              25                     14.819                 1.493
##   max.AUCpROC.fit max.Sens.fit max.Spec.fit max.AUCROCR.fit
## 1        0.621966    0.3992718    0.8446602        0.699893
##   opt.prob.threshold.fit max.f.score.fit max.Accuracy.fit
## 1                   0.55       0.7180805        0.6128487
##   max.AccuracyLower.fit max.AccuracyUpper.fit max.Kappa.fit
## 1             0.6423517             0.6846987     0.1649007
##   max.AUCpROC.OOB max.Sens.OOB max.Spec.OOB max.AUCROCR.OOB
## 1        0.555442    0.3504673    0.7604167       0.5688766
##   opt.prob.threshold.OOB max.f.score.OOB max.Accuracy.OOB
## 1                    0.5       0.6780186        0.5856574
##   max.AccuracyLower.OOB max.AccuracyUpper.OOB max.Kappa.OOB
## 1             0.5411697             0.6291304     0.1157481
##   max.AccuracySD.fit max.KappaSD.fit
## 1        0.009997796        0.019356
## [1] "myfit_mdl: exit: 26.109000 secs"
## [1] "myfit_mdl: enter: 0.001000 secs"
## [1] "myfit_mdl: fitting model: All.X#center.scale#rcv#glmnet"
## [1] "    indepVar: Q115611.fctr,Q113181.fctr,Q98197.fctr,Q116881.fctr,Q108855.fctr,Q106272.fctr,Q122771.fctr,Q123621.fctr,Q106388.fctr,Q110740.fctr,Q122769.fctr,Q120472.fctr,Q101596.fctr,Q119334.fctr,Q114152.fctr,Q98869.fctr,Q115899.fctr,Q116797.fctr,Q118232.fctr,Gender.fctr,Q105655.fctr,Q99480.fctr,Q123464.fctr,Q120650.fctr,Q122120.fctr,Q107869.fctr,Q120014.fctr,Q102289.fctr,Income.fctr,Q122770.fctr,Q111580.fctr,Q116601.fctr,Q117186.fctr,Q106993.fctr,Q112270.fctr,Q101162.fctr,Q108856.fctr,Q117193.fctr,Q116441.fctr,Q119851.fctr,Q111848.fctr,Q98578.fctr,Q118892.fctr,Q114386.fctr,Q120978.fctr,Q112512.fctr,Q102674.fctr,Q96024.fctr,Q108950.fctr,Q115610.fctr,YOB.Age.fctr,Q112478.fctr,Q116197.fctr,Q124742.fctr,Q106389.fctr,Edn.fctr,Q118117.fctr,Q100562.fctr,Q107491.fctr,Q116448.fctr,Q108754.fctr,Q116953.fctr,Q115602.fctr,Q118233.fctr,Q120012.fctr,Q118237.fctr,Q99581.fctr,.rnorm,Q120194.fctr,Q115777.fctr,Q106997.fctr,Q100680.fctr,Q113584.fctr,Q108343.fctr,Q121700.fctr,Q105840.fctr,Q120379.fctr,Q103293.fctr,Q124122.fctr,Q109367.fctr,Q113992.fctr,Q121699.fctr,Q121011.fctr,Q114748.fctr,Q106042.fctr,Q111220.fctr,Q114517.fctr,Q102687.fctr,Q102906.fctr,Q98078.fctr,Q115390.fctr,Q102089.fctr,Q100010.fctr,Q99982.fctr,Q113583.fctr,Q108342.fctr,Q104996.fctr,Q119650.fctr,Q100689.fctr,Q108617.fctr,Q115195.fctr,Q99716.fctr,Q101163.fctr,Q98059.fctr,Q114961.fctr,Hhold.fctr,Hhold.fctr:.clusterid.fctr,YOB.Age.fctr:YOB.Age.dff"
## [1] "myfit_mdl: setup complete: 0.670000 secs"
## Warning in preProcess.default(method = c("center", "scale"), x =
## structure(c(-0.480112420809766, : These variables have zero variances:
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff
## Aggregating results
## Selecting tuning parameters
## Fitting alpha = 0.325, lambda = 0.0333 on full training set
## Warning in preProcess.default(thresh = 0.95, k = 5, method = c("center", :
## These variables have zero variances: Hhold.fctrPKn:.clusterid.fctr4,
## Hhold.fctrSKn:.clusterid.fctr4, Hhold.fctrSKy:.clusterid.fctr4,
## YOB.Age.fctrNA:YOB.Age.dff

## [1] "myfit_mdl: train complete: 17.717000 secs"
## Warning in myfit_mdl(mdl_specs_lst = myinit_mdl_specs_lst(mdl_specs_lst =
## list(id.prefix = bstMdlIdComponents$family, : model's bestTune found at an
## extreme of tuneGrid for parameter: lambda

##             Length Class      Mode     
## a0             85  -none-     numeric  
## beta        22100  dgCMatrix  S4       
## df             85  -none-     numeric  
## dim             2  -none-     numeric  
## lambda         85  -none-     numeric  
## dev.ratio      85  -none-     numeric  
## nulldev         1  -none-     numeric  
## npasses         1  -none-     numeric  
## jerr            1  -none-     numeric  
## offset          1  -none-     logical  
## classnames      2  -none-     character
## call            5  -none-     call     
## nobs            1  -none-     numeric  
## lambdaOpt       1  -none-     numeric  
## xNames        260  -none-     character
## problemType     1  -none-     character
## tuneValue       2  data.frame list     
## obsLevels       2  -none-     character
## [1] "min lambda > lambdaOpt:"
##                     (Intercept)                   Hhold.fctrMKy 
##                    0.3353785090                    0.0582685657 
##                   Hhold.fctrPKn                   Hhold.fctrPKy 
##                   -0.0857222952                   -0.0557948230 
##                   Hhold.fctrSKy                   Income.fctr.Q 
##                   -0.0189496586                    0.0375248761 
##                   Income.fctr.C                   Income.fctr^6 
##                    0.0378139429                   -0.0214429930 
##                  Q100562.fctrNo                 Q100689.fctrYes 
##                   -0.0453982312                   -0.0121334702 
##                 Q101163.fctrDad                 Q102089.fctrOwn 
##                    0.0804768974                    0.0104433630 
##                 Q104996.fctrYes                 Q105655.fctrYes 
##                   -0.0363894639                    0.0497457184 
##                  Q106272.fctrNo                 Q106272.fctrYes 
##                   -0.0411765569                    0.0052928490 
##                 Q106388.fctrYes                  Q106997.fctrGr 
##                    0.0095044705                    0.0859423441 
##                  Q106997.fctrYy              Q108855.fctrUmm... 
##                   -0.0002684511                   -0.0304420846 
##                Q108855.fctrYes!                  Q109367.fctrNo 
##                    0.0021809210                    0.0379086758 
##                 Q109367.fctrYes                  Q110740.fctrPC 
##                   -0.0115562742                    0.0308013595 
##                  Q112512.fctrNo                  Q113181.fctrNo 
##                   -0.0033188626                   -0.1279277954 
##                 Q113181.fctrYes          Q114386.fctrMysterious 
##                    0.0430621139                   -0.0244124521 
##                  Q114517.fctrNo                  Q115390.fctrNo 
##                   -0.0440510918                    0.0017532494 
##                  Q115611.fctrNo                 Q115611.fctrYes 
##                   -0.0433714261                    0.1414192000 
##                  Q115899.fctrCs                  Q116601.fctrNo 
##                   -0.0329012272                   -0.0186047389 
##               Q116881.fctrHappy               Q116881.fctrRight 
##                   -0.0328458949                    0.0881059093 
##                  Q116953.fctrNo      Q117193.fctrStandard hours 
##                    0.0232803894                    0.0178105863 
##                  Q118892.fctrNo              Q119650.fctrGiving 
##                   -0.0366364805                    0.0558624455 
##         Q120194.fctrStudy first                 Q120379.fctrYes 
##                   -0.0017053109                   -0.0158780334 
##             Q120472.fctrScience                 Q122769.fctrYes 
##                    0.0369922916                    0.0123436296 
##                  Q122771.fctrPt                 Q123464.fctrYes 
##                    0.0033537563                    0.0003808286 
##                 Q123621.fctrYes                  Q124742.fctrNo 
##                    0.0343880652                   -0.0521513512 
##                   Q96024.fctrNo                   Q98197.fctrNo 
##                   -0.0044886901                   -0.0831066391 
##                   Q98869.fctrNo                   Q99480.fctrNo 
##                   -0.0706569408                   -0.0732669015 
##                  Q99480.fctrYes                  Q99716.fctrYes 
##                    0.0076123789                   -0.0229261739 
##  Hhold.fctrSKn:.clusterid.fctr2  Hhold.fctrSKy:.clusterid.fctr3 
##                    0.0340559799                   -0.0209627029 
##    Hhold.fctrN:.clusterid.fctr4  Hhold.fctrMKy:.clusterid.fctr4 
##                    0.0233023235                    0.0208175684 
##  Hhold.fctrPKy:.clusterid.fctr4 YOB.Age.fctr(25,30]:YOB.Age.dff 
##                    0.0346778640                    0.0193079561 
## YOB.Age.fctr(35,40]:YOB.Age.dff 
##                   -0.0346153145 
## [1] "max lambda < lambdaOpt:"
##                     (Intercept)                   Hhold.fctrMKy 
##                    0.3368045290                    0.0604400706 
##                   Hhold.fctrPKn                   Hhold.fctrPKy 
##                   -0.0894554154                   -0.0620453168 
##                   Hhold.fctrSKy                   Income.fctr.Q 
##                   -0.0212690688                    0.0411958821 
##                   Income.fctr.C                   Income.fctr^6 
##                    0.0442295787                   -0.0260159873 
##                  Q100562.fctrNo                 Q100689.fctrYes 
##                   -0.0494254458                   -0.0180709793 
##                 Q101163.fctrDad                 Q102089.fctrOwn 
##                    0.0843263803                    0.0144604979 
##                 Q104996.fctrYes                 Q105655.fctrYes 
##                   -0.0421336716                    0.0537495668 
##                  Q106272.fctrNo                 Q106272.fctrYes 
##                   -0.0440962950                    0.0061537156 
##                 Q106388.fctrYes                  Q106997.fctrGr 
##                    0.0118220695                    0.0908393370 
##                  Q106997.fctrYy              Q108855.fctrUmm... 
##                   -0.0036855537                   -0.0346197217 
##                Q108855.fctrYes!                  Q109367.fctrNo 
##                    0.0020635074                    0.0412091249 
##                 Q109367.fctrYes                  Q110740.fctrPC 
##                   -0.0121587305                    0.0337873914 
##                  Q112512.fctrNo                  Q113181.fctrNo 
##                   -0.0077184208                   -0.1304684021 
##                 Q113181.fctrYes          Q114386.fctrMysterious 
##                    0.0415001715                   -0.0297775619 
##                  Q114517.fctrNo                  Q115390.fctrNo 
##                   -0.0494363509                    0.0057597672 
##                  Q115611.fctrNo                 Q115611.fctrYes 
##                   -0.0419695889                    0.1456303371 
##                  Q115899.fctrCs                Q116197.fctrA.M. 
##                   -0.0369977321                    0.0011445068 
##                  Q116601.fctrNo               Q116881.fctrHappy 
##                   -0.0225810498                   -0.0360484418 
##               Q116881.fctrRight                  Q116953.fctrNo 
##                    0.0898487476                    0.0266948858 
##      Q117193.fctrStandard hours                 Q118233.fctrYes 
##                    0.0230113403                   -0.0002013763 
##                  Q118892.fctrNo              Q119650.fctrGiving 
##                   -0.0424150852                    0.0610822146 
##         Q120194.fctrStudy first                 Q120379.fctrYes 
##                   -0.0055384870                   -0.0216543760 
##             Q120472.fctrScience                 Q122120.fctrYes 
##                    0.0422311228                    0.0034867935 
##                 Q122769.fctrYes                  Q122771.fctrPt 
##                    0.0155657944                    0.0064870270 
##                 Q123464.fctrYes                 Q123621.fctrYes 
##                    0.0060694262                    0.0370626403 
##                  Q124742.fctrNo                   Q96024.fctrNo 
##                   -0.0574081038                   -0.0062556082 
##                  Q98059.fctrYes                   Q98197.fctrNo 
##                   -0.0003727267                   -0.0849754591 
##                   Q98869.fctrNo                   Q99480.fctrNo 
##                   -0.0731334996                   -0.0747086313 
##                  Q99480.fctrYes                  Q99716.fctrYes 
##                    0.0105675685                   -0.0265170703 
##  Hhold.fctrPKy:.clusterid.fctr2  Hhold.fctrSKn:.clusterid.fctr2 
##                   -0.0001313043                    0.0384869213 
##  Hhold.fctrSKy:.clusterid.fctr3    Hhold.fctrN:.clusterid.fctr4 
##                   -0.0242796402                    0.0278282151 
##  Hhold.fctrMKy:.clusterid.fctr4  Hhold.fctrPKy:.clusterid.fctr4 
##                    0.0242836273                    0.0411585707 
## YOB.Age.fctr(25,30]:YOB.Age.dff YOB.Age.fctr(35,40]:YOB.Age.dff 
##                    0.0239437711                   -0.0390044204 
## [1] "myfit_mdl: train diagnostics complete: 18.367000 secs"

##          Prediction
## Reference   D   R
##         D 461 363
##         R 295 838
##       Accuracy          Kappa  AccuracyLower  AccuracyUpper   AccuracyNull 
##   6.637711e-01   3.024994e-01   6.423517e-01   6.846987e-01   5.789474e-01 
## AccuracyPValue  McnemarPValue 
##   8.843720e-15   9.003218e-03

## [1] "mypredict_mdl: maxMetricDf:"
##    threshold   f.score  accuracy
## 10      0.45 0.7078652 0.5856574
## 11      0.50 0.6780186 0.5856574
##          Prediction
## Reference   D   R
##         D  75 139
##         R  69 219
##       Accuracy          Kappa  AccuracyLower  AccuracyUpper   AccuracyNull 
##   5.856574e-01   1.157481e-01   5.411697e-01   6.291304e-01   5.737052e-01 
## AccuracyPValue  McnemarPValue 
##   3.104270e-01   1.715935e-06 
## [1] "myfit_mdl: predict complete: 28.048000 secs"
##                              id
## 1 All.X#center.scale#rcv#glmnet
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           feats
## 1 Q115611.fctr,Q113181.fctr,Q98197.fctr,Q116881.fctr,Q108855.fctr,Q106272.fctr,Q122771.fctr,Q123621.fctr,Q106388.fctr,Q110740.fctr,Q122769.fctr,Q120472.fctr,Q101596.fctr,Q119334.fctr,Q114152.fctr,Q98869.fctr,Q115899.fctr,Q116797.fctr,Q118232.fctr,Gender.fctr,Q105655.fctr,Q99480.fctr,Q123464.fctr,Q120650.fctr,Q122120.fctr,Q107869.fctr,Q120014.fctr,Q102289.fctr,Income.fctr,Q122770.fctr,Q111580.fctr,Q116601.fctr,Q117186.fctr,Q106993.fctr,Q112270.fctr,Q101162.fctr,Q108856.fctr,Q117193.fctr,Q116441.fctr,Q119851.fctr,Q111848.fctr,Q98578.fctr,Q118892.fctr,Q114386.fctr,Q120978.fctr,Q112512.fctr,Q102674.fctr,Q96024.fctr,Q108950.fctr,Q115610.fctr,YOB.Age.fctr,Q112478.fctr,Q116197.fctr,Q124742.fctr,Q106389.fctr,Edn.fctr,Q118117.fctr,Q100562.fctr,Q107491.fctr,Q116448.fctr,Q108754.fctr,Q116953.fctr,Q115602.fctr,Q118233.fctr,Q120012.fctr,Q118237.fctr,Q99581.fctr,.rnorm,Q120194.fctr,Q115777.fctr,Q106997.fctr,Q100680.fctr,Q113584.fctr,Q108343.fctr,Q121700.fctr,Q105840.fctr,Q120379.fctr,Q103293.fctr,Q124122.fctr,Q109367.fctr,Q113992.fctr,Q121699.fctr,Q121011.fctr,Q114748.fctr,Q106042.fctr,Q111220.fctr,Q114517.fctr,Q102687.fctr,Q102906.fctr,Q98078.fctr,Q115390.fctr,Q102089.fctr,Q100010.fctr,Q99982.fctr,Q113583.fctr,Q108342.fctr,Q104996.fctr,Q119650.fctr,Q100689.fctr,Q108617.fctr,Q115195.fctr,Q99716.fctr,Q101163.fctr,Q98059.fctr,Q114961.fctr,Hhold.fctr,Hhold.fctr:.clusterid.fctr,YOB.Age.fctr:YOB.Age.dff
##   max.nTuningRuns min.elapsedtime.everything min.elapsedtime.final
## 1              25                     16.964                 1.664
##   max.AUCpROC.fit max.Sens.fit max.Spec.fit max.AUCROCR.fit
## 1        0.621966    0.3992718    0.8446602        0.699893
##   opt.prob.threshold.fit max.f.score.fit max.Accuracy.fit
## 1                   0.55       0.7180805        0.6128487
##   max.AccuracyLower.fit max.AccuracyUpper.fit max.Kappa.fit
## 1             0.6423517             0.6846987     0.1649007
##   max.AUCpROC.OOB max.Sens.OOB max.Spec.OOB max.AUCROCR.OOB
## 1        0.555442    0.3504673    0.7604167       0.5688766
##   opt.prob.threshold.OOB max.f.score.OOB max.Accuracy.OOB
## 1                    0.5       0.6780186        0.5856574
##   max.AccuracyLower.OOB max.AccuracyUpper.OOB max.Kappa.OOB
## 1             0.5411697             0.6291304     0.1157481
##   max.AccuracySD.fit max.KappaSD.fit
## 1        0.009997796        0.019356
## [1] "myfit_mdl: exit: 28.430000 secs"
## [1] "myfit_mdl: enter: 0.001000 secs"
## [1] "myfit_mdl: fitting model: All.X#range#rcv#glmnet"
## [1] "    indepVar: Q115611.fctr,Q113181.fctr,Q98197.fctr,Q116881.fctr,Q108855.fctr,Q106272.fctr,Q122771.fctr,Q123621.fctr,Q106388.fctr,Q110740.fctr,Q122769.fctr,Q120472.fctr,Q101596.fctr,Q119334.fctr,Q114152.fctr,Q98869.fctr,Q115899.fctr,Q116797.fctr,Q118232.fctr,Gender.fctr,Q105655.fctr,Q99480.fctr,Q123464.fctr,Q120650.fctr,Q122120.fctr,Q107869.fctr,Q120014.fctr,Q102289.fctr,Income.fctr,Q122770.fctr,Q111580.fctr,Q116601.fctr,Q117186.fctr,Q106993.fctr,Q112270.fctr,Q101162.fctr,Q108856.fctr,Q117193.fctr,Q116441.fctr,Q119851.fctr,Q111848.fctr,Q98578.fctr,Q118892.fctr,Q114386.fctr,Q120978.fctr,Q112512.fctr,Q102674.fctr,Q96024.fctr,Q108950.fctr,Q115610.fctr,YOB.Age.fctr,Q112478.fctr,Q116197.fctr,Q124742.fctr,Q106389.fctr,Edn.fctr,Q118117.fctr,Q100562.fctr,Q107491.fctr,Q116448.fctr,Q108754.fctr,Q116953.fctr,Q115602.fctr,Q118233.fctr,Q120012.fctr,Q118237.fctr,Q99581.fctr,.rnorm,Q120194.fctr,Q115777.fctr,Q106997.fctr,Q100680.fctr,Q113584.fctr,Q108343.fctr,Q121700.fctr,Q105840.fctr,Q120379.fctr,Q103293.fctr,Q124122.fctr,Q109367.fctr,Q113992.fctr,Q121699.fctr,Q121011.fctr,Q114748.fctr,Q106042.fctr,Q111220.fctr,Q114517.fctr,Q102687.fctr,Q102906.fctr,Q98078.fctr,Q115390.fctr,Q102089.fctr,Q100010.fctr,Q99982.fctr,Q113583.fctr,Q108342.fctr,Q104996.fctr,Q119650.fctr,Q100689.fctr,Q108617.fctr,Q115195.fctr,Q99716.fctr,Q101163.fctr,Q98059.fctr,Q114961.fctr,Hhold.fctr,Hhold.fctr:.clusterid.fctr,YOB.Age.fctr:YOB.Age.dff"
## [1] "myfit_mdl: setup complete: 0.716000 secs"
## Warning in preProcess.default(method = "range", x =
## structure(c(-0.480112420809766, : No variation for for:
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff
## Aggregating results
## Selecting tuning parameters
## Fitting alpha = 0.325, lambda = 0.0333 on full training set
## Warning in preProcess.default(thresh = 0.95, k = 5, method =
## "range", x = structure(c(-0.480112420809766, : No variation for
## for: Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff

## [1] "myfit_mdl: train complete: 16.252000 secs"
## Warning in myfit_mdl(mdl_specs_lst = myinit_mdl_specs_lst(mdl_specs_lst =
## list(id.prefix = bstMdlIdComponents$family, : model's bestTune found at an
## extreme of tuneGrid for parameter: lambda

##             Length Class      Mode     
## a0             85  -none-     numeric  
## beta        22100  dgCMatrix  S4       
## df             85  -none-     numeric  
## dim             2  -none-     numeric  
## lambda         85  -none-     numeric  
## dev.ratio      85  -none-     numeric  
## nulldev         1  -none-     numeric  
## npasses         1  -none-     numeric  
## jerr            1  -none-     numeric  
## offset          1  -none-     logical  
## classnames      2  -none-     character
## call            5  -none-     call     
## nobs            1  -none-     numeric  
## lambdaOpt       1  -none-     numeric  
## xNames        260  -none-     character
## problemType     1  -none-     character
## tuneValue       2  data.frame list     
## obsLevels       2  -none-     character
## [1] "min lambda > lambdaOpt:"
##                     (Intercept)                   Hhold.fctrMKy 
##                    0.2216507808                    0.1223388126 
##                   Hhold.fctrPKn                   Hhold.fctrPKy 
##                   -0.5431418661                   -0.6618709561 
##                   Hhold.fctrSKy                   Income.fctr.Q 
##                   -0.1090177325                    0.0962696997 
##                   Income.fctr.C                   Income.fctr^6 
##                    0.0824986160                   -0.0643118203 
##                  Q100562.fctrNo                 Q100689.fctrYes 
##                   -0.1227211571                   -0.0242725337 
##                 Q101163.fctrDad                 Q102089.fctrOwn 
##                    0.1609136964                    0.0213110713 
##                 Q104996.fctrYes                 Q105655.fctrYes 
##                   -0.0733859891                    0.0994923204 
##                  Q106272.fctrNo                 Q106272.fctrYes 
##                   -0.0985282958                    0.0109728198 
##                 Q106388.fctrYes                  Q106997.fctrGr 
##                    0.0222597292                    0.1722153193 
##                  Q106997.fctrYy              Q108855.fctrUmm... 
##                   -0.0005482815                   -0.0640940960 
##                Q108855.fctrYes!                  Q109367.fctrNo 
##                    0.0043637645                    0.0776512027 
##                 Q109367.fctrYes                  Q110740.fctrPC 
##                   -0.0232319681                    0.0617129947 
##                  Q112512.fctrNo                  Q113181.fctrNo 
##                   -0.0089942731                   -0.2565348387 
##                 Q113181.fctrYes          Q114386.fctrMysterious 
##                    0.0883115008                   -0.0488277360 
##                  Q114517.fctrNo                  Q115390.fctrNo 
##                   -0.0891692654                    0.0037303385 
##                  Q115611.fctrNo                 Q115611.fctrYes 
##                   -0.0867549557                    0.2945956632 
##                  Q115899.fctrCs                  Q116601.fctrNo 
##                   -0.0700586145                   -0.0530411889 
##               Q116881.fctrHappy               Q116881.fctrRight 
##                   -0.0660674927                    0.2077280095 
##                  Q116953.fctrNo      Q117193.fctrStandard hours 
##                    0.0531229393                    0.0358169094 
##                  Q118892.fctrNo              Q119650.fctrGiving 
##                   -0.0768159368                    0.1151091086 
##         Q120194.fctrStudy first                 Q120379.fctrYes 
##                   -0.0034275168                   -0.0337302239 
##             Q120472.fctrScience                 Q122769.fctrYes 
##                    0.0750873634                    0.0270370204 
##                  Q122771.fctrPt                 Q123464.fctrYes 
##                    0.0093972520                    0.0018784552 
##                 Q123621.fctrYes                  Q124742.fctrNo 
##                    0.0702491183                   -0.1091270840 
##                   Q96024.fctrNo                   Q98197.fctrNo 
##                   -0.0097694988                   -0.1666944739 
##                   Q98869.fctrNo                   Q99480.fctrNo 
##                   -0.1988235708                   -0.1985567368 
##                  Q99480.fctrYes                  Q99716.fctrYes 
##                    0.0163095000                   -0.0848727311 
##  Hhold.fctrSKn:.clusterid.fctr2  Hhold.fctrSKy:.clusterid.fctr3 
##                    0.0972361315                   -0.2486718925 
##    Hhold.fctrN:.clusterid.fctr4  Hhold.fctrMKy:.clusterid.fctr4 
##                    0.2316323732                    0.0799692788 
##  Hhold.fctrPKy:.clusterid.fctr4 YOB.Age.fctr(25,30]:YOB.Age.dff 
##                    1.0850351271                    0.0874531579 
## YOB.Age.fctr(35,40]:YOB.Age.dff 
##                   -0.1693273916 
## [1] "max lambda < lambdaOpt:"
##                     (Intercept)                   Hhold.fctrMKy 
##                    0.2181242685                    0.1268980348 
##                   Hhold.fctrPKn                   Hhold.fctrPKy 
##                   -0.5667951509                   -0.7360179842 
##                   Hhold.fctrSKy                   Income.fctr.Q 
##                   -0.1223613415                    0.1056876292 
##                   Income.fctr.C                   Income.fctr^6 
##                    0.0964955979                   -0.0780271437 
##                  Q100562.fctrNo                 Q100689.fctrYes 
##                   -0.1336075822                   -0.0361502891 
##                 Q101163.fctrDad                 Q102089.fctrOwn 
##                    0.1686107441                    0.0295085694 
##                 Q104996.fctrYes                 Q105655.fctrYes 
##                   -0.0849702314                    0.1075000884 
##                  Q106272.fctrNo                 Q106272.fctrYes 
##                   -0.1055147182                    0.0127575171 
##                 Q106388.fctrYes                  Q106997.fctrGr 
##                    0.0276876095                    0.1820281443 
##                  Q106997.fctrYy              Q108855.fctrUmm... 
##                   -0.0075273343                   -0.0728898757 
##                Q108855.fctrYes!                  Q109367.fctrNo 
##                    0.0041288338                    0.0844117618 
##                 Q109367.fctrYes                  Q110740.fctrPC 
##                   -0.0244431062                    0.0676957492 
##                  Q112512.fctrNo                  Q113181.fctrNo 
##                   -0.0209172822                   -0.2616295419 
##                 Q113181.fctrYes          Q114386.fctrMysterious 
##                    0.0851082794                   -0.0595585781 
##                  Q114517.fctrNo                  Q115390.fctrNo 
##                   -0.1000702347                    0.0122548916 
##                  Q115611.fctrNo                 Q115611.fctrYes 
##                   -0.0839508900                    0.3033680414 
##                  Q115899.fctrCs                Q116197.fctrA.M. 
##                   -0.0787815553                    0.0025657763 
##                  Q116601.fctrNo               Q116881.fctrHappy 
##                   -0.0643774543                   -0.0725092183 
##               Q116881.fctrRight                  Q116953.fctrNo 
##                    0.2118371133                    0.0609143935 
##      Q117193.fctrStandard hours                 Q118233.fctrYes 
##                    0.0462755734                   -0.0004803217 
##                  Q118892.fctrNo              Q119650.fctrGiving 
##                   -0.0889319734                    0.1258648670 
##         Q120194.fctrStudy first                 Q120379.fctrYes 
##                   -0.0111318453                   -0.0460010967 
##             Q120472.fctrScience                 Q122120.fctrYes 
##                    0.0857212012                    0.0087862652 
##                 Q122769.fctrYes                  Q122771.fctrPt 
##                    0.0340947285                    0.0181767014 
##                 Q123464.fctrYes                 Q123621.fctrYes 
##                    0.0299377349                    0.0757128321 
##                  Q124742.fctrNo                   Q96024.fctrNo 
##                   -0.1201268773                   -0.0136151428 
##                  Q98059.fctrYes                   Q98197.fctrNo 
##                   -0.0008977055                   -0.1704429347 
##                   Q98869.fctrNo                   Q99480.fctrNo 
##                   -0.2057924299                   -0.2024638922 
##                  Q99480.fctrYes                  Q99716.fctrYes 
##                    0.0226409850                   -0.0981662351 
##  Hhold.fctrPKy:.clusterid.fctr2  Hhold.fctrSKn:.clusterid.fctr2 
##                   -0.0058086382                    0.1098872900 
##  Hhold.fctrSKy:.clusterid.fctr3    Hhold.fctrN:.clusterid.fctr4 
##                   -0.2880193501                    0.2766211491 
##  Hhold.fctrMKy:.clusterid.fctr4  Hhold.fctrPKy:.clusterid.fctr4 
##                    0.0932839092                    1.2878098547 
## YOB.Age.fctr(25,30]:YOB.Age.dff YOB.Age.fctr(35,40]:YOB.Age.dff 
##                    0.1084505466                   -0.1907975377 
## [1] "myfit_mdl: train diagnostics complete: 16.922000 secs"

##          Prediction
## Reference   D   R
##         D 461 363
##         R 295 838
##       Accuracy          Kappa  AccuracyLower  AccuracyUpper   AccuracyNull 
##   6.637711e-01   3.024994e-01   6.423517e-01   6.846987e-01   5.789474e-01 
## AccuracyPValue  McnemarPValue 
##   8.843720e-15   9.003218e-03

## [1] "mypredict_mdl: maxMetricDf:"
##    threshold   f.score  accuracy
## 10      0.45 0.7078652 0.5856574
## 11      0.50 0.6780186 0.5856574

##          Prediction
## Reference   D   R
##         D  75 139
##         R  69 219
##       Accuracy          Kappa  AccuracyLower  AccuracyUpper   AccuracyNull 
##   5.856574e-01   1.157481e-01   5.411697e-01   6.291304e-01   5.737052e-01 
## AccuracyPValue  McnemarPValue 
##   3.104270e-01   1.715935e-06 
## [1] "myfit_mdl: predict complete: 26.550000 secs"
##                       id
## 1 All.X#range#rcv#glmnet
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           feats
## 1 Q115611.fctr,Q113181.fctr,Q98197.fctr,Q116881.fctr,Q108855.fctr,Q106272.fctr,Q122771.fctr,Q123621.fctr,Q106388.fctr,Q110740.fctr,Q122769.fctr,Q120472.fctr,Q101596.fctr,Q119334.fctr,Q114152.fctr,Q98869.fctr,Q115899.fctr,Q116797.fctr,Q118232.fctr,Gender.fctr,Q105655.fctr,Q99480.fctr,Q123464.fctr,Q120650.fctr,Q122120.fctr,Q107869.fctr,Q120014.fctr,Q102289.fctr,Income.fctr,Q122770.fctr,Q111580.fctr,Q116601.fctr,Q117186.fctr,Q106993.fctr,Q112270.fctr,Q101162.fctr,Q108856.fctr,Q117193.fctr,Q116441.fctr,Q119851.fctr,Q111848.fctr,Q98578.fctr,Q118892.fctr,Q114386.fctr,Q120978.fctr,Q112512.fctr,Q102674.fctr,Q96024.fctr,Q108950.fctr,Q115610.fctr,YOB.Age.fctr,Q112478.fctr,Q116197.fctr,Q124742.fctr,Q106389.fctr,Edn.fctr,Q118117.fctr,Q100562.fctr,Q107491.fctr,Q116448.fctr,Q108754.fctr,Q116953.fctr,Q115602.fctr,Q118233.fctr,Q120012.fctr,Q118237.fctr,Q99581.fctr,.rnorm,Q120194.fctr,Q115777.fctr,Q106997.fctr,Q100680.fctr,Q113584.fctr,Q108343.fctr,Q121700.fctr,Q105840.fctr,Q120379.fctr,Q103293.fctr,Q124122.fctr,Q109367.fctr,Q113992.fctr,Q121699.fctr,Q121011.fctr,Q114748.fctr,Q106042.fctr,Q111220.fctr,Q114517.fctr,Q102687.fctr,Q102906.fctr,Q98078.fctr,Q115390.fctr,Q102089.fctr,Q100010.fctr,Q99982.fctr,Q113583.fctr,Q108342.fctr,Q104996.fctr,Q119650.fctr,Q100689.fctr,Q108617.fctr,Q115195.fctr,Q99716.fctr,Q101163.fctr,Q98059.fctr,Q114961.fctr,Hhold.fctr,Hhold.fctr:.clusterid.fctr,YOB.Age.fctr:YOB.Age.dff
##   max.nTuningRuns min.elapsedtime.everything min.elapsedtime.final
## 1              25                     15.454                 1.571
##   max.AUCpROC.fit max.Sens.fit max.Spec.fit max.AUCROCR.fit
## 1        0.621966    0.3992718    0.8446602        0.699893
##   opt.prob.threshold.fit max.f.score.fit max.Accuracy.fit
## 1                   0.55       0.7180805        0.6128487
##   max.AccuracyLower.fit max.AccuracyUpper.fit max.Kappa.fit
## 1             0.6423517             0.6846987     0.1649007
##   max.AUCpROC.OOB max.Sens.OOB max.Spec.OOB max.AUCROCR.OOB
## 1        0.555442    0.3504673    0.7604167       0.5688766
##   opt.prob.threshold.OOB max.f.score.OOB max.Accuracy.OOB
## 1                    0.5       0.6780186        0.5856574
##   max.AccuracyLower.OOB max.AccuracyUpper.OOB max.Kappa.OOB
## 1             0.5411697             0.6291304     0.1157481
##   max.AccuracySD.fit max.KappaSD.fit
## 1        0.009997796        0.019356
## [1] "myfit_mdl: exit: 26.930000 secs"
## [1] "myfit_mdl: enter: 0.001000 secs"
## [1] "myfit_mdl: fitting model: All.X#zv.pca#rcv#glmnet"
## [1] "    indepVar: Q115611.fctr,Q113181.fctr,Q98197.fctr,Q116881.fctr,Q108855.fctr,Q106272.fctr,Q122771.fctr,Q123621.fctr,Q106388.fctr,Q110740.fctr,Q122769.fctr,Q120472.fctr,Q101596.fctr,Q119334.fctr,Q114152.fctr,Q98869.fctr,Q115899.fctr,Q116797.fctr,Q118232.fctr,Gender.fctr,Q105655.fctr,Q99480.fctr,Q123464.fctr,Q120650.fctr,Q122120.fctr,Q107869.fctr,Q120014.fctr,Q102289.fctr,Income.fctr,Q122770.fctr,Q111580.fctr,Q116601.fctr,Q117186.fctr,Q106993.fctr,Q112270.fctr,Q101162.fctr,Q108856.fctr,Q117193.fctr,Q116441.fctr,Q119851.fctr,Q111848.fctr,Q98578.fctr,Q118892.fctr,Q114386.fctr,Q120978.fctr,Q112512.fctr,Q102674.fctr,Q96024.fctr,Q108950.fctr,Q115610.fctr,YOB.Age.fctr,Q112478.fctr,Q116197.fctr,Q124742.fctr,Q106389.fctr,Edn.fctr,Q118117.fctr,Q100562.fctr,Q107491.fctr,Q116448.fctr,Q108754.fctr,Q116953.fctr,Q115602.fctr,Q118233.fctr,Q120012.fctr,Q118237.fctr,Q99581.fctr,.rnorm,Q120194.fctr,Q115777.fctr,Q106997.fctr,Q100680.fctr,Q113584.fctr,Q108343.fctr,Q121700.fctr,Q105840.fctr,Q120379.fctr,Q103293.fctr,Q124122.fctr,Q109367.fctr,Q113992.fctr,Q121699.fctr,Q121011.fctr,Q114748.fctr,Q106042.fctr,Q111220.fctr,Q114517.fctr,Q102687.fctr,Q102906.fctr,Q98078.fctr,Q115390.fctr,Q102089.fctr,Q100010.fctr,Q99982.fctr,Q113583.fctr,Q108342.fctr,Q104996.fctr,Q119650.fctr,Q100689.fctr,Q108617.fctr,Q115195.fctr,Q99716.fctr,Q101163.fctr,Q98059.fctr,Q114961.fctr,Hhold.fctr,Hhold.fctr:.clusterid.fctr,YOB.Age.fctr:YOB.Age.dff"
## [1] "myfit_mdl: setup complete: 0.673000 secs"
## + Fold1.Rep1: alpha=0.100, lambda=0.02429 
## - Fold1.Rep1: alpha=0.100, lambda=0.02429 
## + Fold1.Rep1: alpha=0.325, lambda=0.02429 
## - Fold1.Rep1: alpha=0.325, lambda=0.02429 
## + Fold1.Rep1: alpha=0.550, lambda=0.02429 
## - Fold1.Rep1: alpha=0.550, lambda=0.02429 
## + Fold1.Rep1: alpha=0.775, lambda=0.02429 
## - Fold1.Rep1: alpha=0.775, lambda=0.02429 
## + Fold1.Rep1: alpha=1.000, lambda=0.02429 
## - Fold1.Rep1: alpha=1.000, lambda=0.02429 
## + Fold2.Rep1: alpha=0.100, lambda=0.02429 
## - Fold2.Rep1: alpha=0.100, lambda=0.02429 
## + Fold2.Rep1: alpha=0.325, lambda=0.02429 
## - Fold2.Rep1: alpha=0.325, lambda=0.02429 
## + Fold2.Rep1: alpha=0.550, lambda=0.02429 
## - Fold2.Rep1: alpha=0.550, lambda=0.02429 
## + Fold2.Rep1: alpha=0.775, lambda=0.02429 
## - Fold2.Rep1: alpha=0.775, lambda=0.02429 
## + Fold2.Rep1: alpha=1.000, lambda=0.02429 
## - Fold2.Rep1: alpha=1.000, lambda=0.02429 
## + Fold3.Rep1: alpha=0.100, lambda=0.02429 
## - Fold3.Rep1: alpha=0.100, lambda=0.02429 
## + Fold3.Rep1: alpha=0.325, lambda=0.02429 
## - Fold3.Rep1: alpha=0.325, lambda=0.02429 
## + Fold3.Rep1: alpha=0.550, lambda=0.02429 
## - Fold3.Rep1: alpha=0.550, lambda=0.02429 
## + Fold3.Rep1: alpha=0.775, lambda=0.02429 
## - Fold3.Rep1: alpha=0.775, lambda=0.02429 
## + Fold3.Rep1: alpha=1.000, lambda=0.02429 
## - Fold3.Rep1: alpha=1.000, lambda=0.02429 
## + Fold1.Rep2: alpha=0.100, lambda=0.02429 
## - Fold1.Rep2: alpha=0.100, lambda=0.02429 
## + Fold1.Rep2: alpha=0.325, lambda=0.02429 
## - Fold1.Rep2: alpha=0.325, lambda=0.02429 
## + Fold1.Rep2: alpha=0.550, lambda=0.02429 
## - Fold1.Rep2: alpha=0.550, lambda=0.02429 
## + Fold1.Rep2: alpha=0.775, lambda=0.02429 
## - Fold1.Rep2: alpha=0.775, lambda=0.02429 
## + Fold1.Rep2: alpha=1.000, lambda=0.02429 
## - Fold1.Rep2: alpha=1.000, lambda=0.02429 
## + Fold2.Rep2: alpha=0.100, lambda=0.02429 
## - Fold2.Rep2: alpha=0.100, lambda=0.02429 
## + Fold2.Rep2: alpha=0.325, lambda=0.02429 
## - Fold2.Rep2: alpha=0.325, lambda=0.02429 
## + Fold2.Rep2: alpha=0.550, lambda=0.02429 
## - Fold2.Rep2: alpha=0.550, lambda=0.02429 
## + Fold2.Rep2: alpha=0.775, lambda=0.02429 
## - Fold2.Rep2: alpha=0.775, lambda=0.02429 
## + Fold2.Rep2: alpha=1.000, lambda=0.02429 
## - Fold2.Rep2: alpha=1.000, lambda=0.02429 
## + Fold3.Rep2: alpha=0.100, lambda=0.02429 
## - Fold3.Rep2: alpha=0.100, lambda=0.02429 
## + Fold3.Rep2: alpha=0.325, lambda=0.02429 
## - Fold3.Rep2: alpha=0.325, lambda=0.02429 
## + Fold3.Rep2: alpha=0.550, lambda=0.02429 
## - Fold3.Rep2: alpha=0.550, lambda=0.02429 
## + Fold3.Rep2: alpha=0.775, lambda=0.02429 
## - Fold3.Rep2: alpha=0.775, lambda=0.02429 
## + Fold3.Rep2: alpha=1.000, lambda=0.02429 
## - Fold3.Rep2: alpha=1.000, lambda=0.02429 
## + Fold1.Rep3: alpha=0.100, lambda=0.02429 
## - Fold1.Rep3: alpha=0.100, lambda=0.02429 
## + Fold1.Rep3: alpha=0.325, lambda=0.02429 
## - Fold1.Rep3: alpha=0.325, lambda=0.02429 
## + Fold1.Rep3: alpha=0.550, lambda=0.02429 
## - Fold1.Rep3: alpha=0.550, lambda=0.02429 
## + Fold1.Rep3: alpha=0.775, lambda=0.02429 
## - Fold1.Rep3: alpha=0.775, lambda=0.02429 
## + Fold1.Rep3: alpha=1.000, lambda=0.02429 
## - Fold1.Rep3: alpha=1.000, lambda=0.02429 
## + Fold2.Rep3: alpha=0.100, lambda=0.02429 
## - Fold2.Rep3: alpha=0.100, lambda=0.02429 
## + Fold2.Rep3: alpha=0.325, lambda=0.02429 
## - Fold2.Rep3: alpha=0.325, lambda=0.02429 
## + Fold2.Rep3: alpha=0.550, lambda=0.02429 
## - Fold2.Rep3: alpha=0.550, lambda=0.02429 
## + Fold2.Rep3: alpha=0.775, lambda=0.02429 
## - Fold2.Rep3: alpha=0.775, lambda=0.02429 
## + Fold2.Rep3: alpha=1.000, lambda=0.02429 
## - Fold2.Rep3: alpha=1.000, lambda=0.02429 
## + Fold3.Rep3: alpha=0.100, lambda=0.02429 
## - Fold3.Rep3: alpha=0.100, lambda=0.02429 
## + Fold3.Rep3: alpha=0.325, lambda=0.02429 
## - Fold3.Rep3: alpha=0.325, lambda=0.02429 
## + Fold3.Rep3: alpha=0.550, lambda=0.02429 
## - Fold3.Rep3: alpha=0.550, lambda=0.02429 
## + Fold3.Rep3: alpha=0.775, lambda=0.02429 
## - Fold3.Rep3: alpha=0.775, lambda=0.02429 
## + Fold3.Rep3: alpha=1.000, lambda=0.02429 
## - Fold3.Rep3: alpha=1.000, lambda=0.02429 
## Aggregating results
## Selecting tuning parameters
## Fitting alpha = 0.775, lambda = 0.0243 on full training set
## [1] "myfit_mdl: train complete: 42.876000 secs"
## Warning in myfit_mdl(mdl_specs_lst = myinit_mdl_specs_lst(mdl_specs_lst =
## list(id.prefix = bstMdlIdComponents$family, : model's bestTune found at an
## extreme of tuneGrid for parameter: lambda

##             Length Class      Mode     
## a0            65   -none-     numeric  
## beta        9490   dgCMatrix  S4       
## df            65   -none-     numeric  
## dim            2   -none-     numeric  
## lambda        65   -none-     numeric  
## dev.ratio     65   -none-     numeric  
## nulldev        1   -none-     numeric  
## npasses        1   -none-     numeric  
## jerr           1   -none-     numeric  
## offset         1   -none-     logical  
## classnames     2   -none-     character
## call           5   -none-     call     
## nobs           1   -none-     numeric  
## lambdaOpt      1   -none-     numeric  
## xNames       146   -none-     character
## problemType    1   -none-     character
## tuneValue      2   data.frame list     
## obsLevels      2   -none-     character
## [1] "min lambda > lambdaOpt:"
##   (Intercept)           PC2           PC3           PC4           PC7 
##  3.236019e-01 -2.823328e-02  5.546607e-02  1.115289e-05  5.453458e-02 
##           PC9          PC14          PC15          PC17          PC27 
## -6.619760e-02 -5.940572e-02 -5.724565e-03  2.017187e-03 -5.410136e-03 
##          PC30          PC38          PC42          PC48          PC84 
## -1.392356e-02  4.973894e-03 -8.691699e-03 -2.897975e-02  1.764252e-02 
##         PC101         PC114         PC118         PC120         PC121 
##  3.794732e-03 -6.291254e-03  8.088300e-03 -1.026525e-02 -4.096242e-02 
##         PC127 
## -2.685008e-02 
## [1] "max lambda < lambdaOpt:"
##   (Intercept)           PC2           PC3           PC4           PC7 
##  0.3245533430 -0.0306746910  0.0585083635  0.0031999884  0.0585529335 
##           PC9          PC14          PC15          PC17          PC22 
## -0.0704141605 -0.0642735896 -0.0104591053  0.0067864724  0.0030560393 
##          PC24          PC27          PC29          PC30          PC38 
## -0.0045827626 -0.0106044837 -0.0049510694 -0.0191420782  0.0104629699 
##          PC42          PC48          PC82          PC84          PC95 
## -0.0143327180 -0.0347440299  0.0003084852  0.0243742872  0.0018522015 
##         PC101         PC114         PC118         PC120         PC121 
##  0.0110442394 -0.0140695404  0.0160689186 -0.0183766924 -0.0491504946 
##         PC127 
## -0.0354056112 
## [1] "myfit_mdl: train diagnostics complete: 43.509000 secs"

##          Prediction
## Reference   D   R
##         D 367 457
##         R 277 856
##       Accuracy          Kappa  AccuracyLower  AccuracyUpper   AccuracyNull 
##   6.249361e-01   2.070730e-01   6.030565e-01   6.464407e-01   5.789474e-01 
## AccuracyPValue  McnemarPValue 
##   1.895803e-05   3.921581e-11

##          Prediction
## Reference   D   R
##         D  92 122
##         R  89 199
##       Accuracy          Kappa  AccuracyLower  AccuracyUpper   AccuracyNull 
##      0.5796813      0.1233219      0.5351418      0.6232769      0.5737052 
## AccuracyPValue  McnemarPValue 
##      0.4115799      0.0275968 
## [1] "myfit_mdl: predict complete: 53.219000 secs"
##                        id
## 1 All.X#zv.pca#rcv#glmnet
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           feats
## 1 Q115611.fctr,Q113181.fctr,Q98197.fctr,Q116881.fctr,Q108855.fctr,Q106272.fctr,Q122771.fctr,Q123621.fctr,Q106388.fctr,Q110740.fctr,Q122769.fctr,Q120472.fctr,Q101596.fctr,Q119334.fctr,Q114152.fctr,Q98869.fctr,Q115899.fctr,Q116797.fctr,Q118232.fctr,Gender.fctr,Q105655.fctr,Q99480.fctr,Q123464.fctr,Q120650.fctr,Q122120.fctr,Q107869.fctr,Q120014.fctr,Q102289.fctr,Income.fctr,Q122770.fctr,Q111580.fctr,Q116601.fctr,Q117186.fctr,Q106993.fctr,Q112270.fctr,Q101162.fctr,Q108856.fctr,Q117193.fctr,Q116441.fctr,Q119851.fctr,Q111848.fctr,Q98578.fctr,Q118892.fctr,Q114386.fctr,Q120978.fctr,Q112512.fctr,Q102674.fctr,Q96024.fctr,Q108950.fctr,Q115610.fctr,YOB.Age.fctr,Q112478.fctr,Q116197.fctr,Q124742.fctr,Q106389.fctr,Edn.fctr,Q118117.fctr,Q100562.fctr,Q107491.fctr,Q116448.fctr,Q108754.fctr,Q116953.fctr,Q115602.fctr,Q118233.fctr,Q120012.fctr,Q118237.fctr,Q99581.fctr,.rnorm,Q120194.fctr,Q115777.fctr,Q106997.fctr,Q100680.fctr,Q113584.fctr,Q108343.fctr,Q121700.fctr,Q105840.fctr,Q120379.fctr,Q103293.fctr,Q124122.fctr,Q109367.fctr,Q113992.fctr,Q121699.fctr,Q121011.fctr,Q114748.fctr,Q106042.fctr,Q111220.fctr,Q114517.fctr,Q102687.fctr,Q102906.fctr,Q98078.fctr,Q115390.fctr,Q102089.fctr,Q100010.fctr,Q99982.fctr,Q113583.fctr,Q108342.fctr,Q104996.fctr,Q119650.fctr,Q100689.fctr,Q108617.fctr,Q115195.fctr,Q99716.fctr,Q101163.fctr,Q98059.fctr,Q114961.fctr,Hhold.fctr,Hhold.fctr:.clusterid.fctr,YOB.Age.fctr:YOB.Age.dff
##   max.nTuningRuns min.elapsedtime.everything min.elapsedtime.final
## 1              25                     42.121                 1.133
##   max.AUCpROC.fit max.Sens.fit max.Spec.fit max.AUCROCR.fit
## 1       0.5597418    0.2050971    0.9143866       0.6546639
##   opt.prob.threshold.fit max.f.score.fit max.Accuracy.fit
## 1                   0.55       0.6999182         0.595983
##   max.AccuracyLower.fit max.AccuracyUpper.fit max.Kappa.fit
## 1             0.6030565             0.6464407    0.09782945
##   max.AUCpROC.OOB max.Sens.OOB max.Spec.OOB max.AUCROCR.OOB
## 1       0.5017848     0.135514    0.8680556       0.5588331
##   opt.prob.threshold.OOB max.f.score.OOB max.Accuracy.OOB
## 1                   0.55       0.6535304        0.5796813
##   max.AccuracyLower.OOB max.AccuracyUpper.OOB max.Kappa.OOB
## 1             0.5351418             0.6232769     0.1233219
##   max.AccuracySD.fit max.KappaSD.fit
## 1        0.008857455       0.0194164
## [1] "myfit_mdl: exit: 53.655000 secs"
## [1] "myfit_mdl: enter: 0.001000 secs"
## [1] "myfit_mdl: fitting model: All.X#ica#rcv#glmnet"
## [1] "    indepVar: Q115611.fctr,Q113181.fctr,Q98197.fctr,Q116881.fctr,Q108855.fctr,Q106272.fctr,Q122771.fctr,Q123621.fctr,Q106388.fctr,Q110740.fctr,Q122769.fctr,Q120472.fctr,Q101596.fctr,Q119334.fctr,Q114152.fctr,Q98869.fctr,Q115899.fctr,Q116797.fctr,Q118232.fctr,Gender.fctr,Q105655.fctr,Q99480.fctr,Q123464.fctr,Q120650.fctr,Q122120.fctr,Q107869.fctr,Q120014.fctr,Q102289.fctr,Income.fctr,Q122770.fctr,Q111580.fctr,Q116601.fctr,Q117186.fctr,Q106993.fctr,Q112270.fctr,Q101162.fctr,Q108856.fctr,Q117193.fctr,Q116441.fctr,Q119851.fctr,Q111848.fctr,Q98578.fctr,Q118892.fctr,Q114386.fctr,Q120978.fctr,Q112512.fctr,Q102674.fctr,Q96024.fctr,Q108950.fctr,Q115610.fctr,YOB.Age.fctr,Q112478.fctr,Q116197.fctr,Q124742.fctr,Q106389.fctr,Edn.fctr,Q118117.fctr,Q100562.fctr,Q107491.fctr,Q116448.fctr,Q108754.fctr,Q116953.fctr,Q115602.fctr,Q118233.fctr,Q120012.fctr,Q118237.fctr,Q99581.fctr,.rnorm,Q120194.fctr,Q115777.fctr,Q106997.fctr,Q100680.fctr,Q113584.fctr,Q108343.fctr,Q121700.fctr,Q105840.fctr,Q120379.fctr,Q103293.fctr,Q124122.fctr,Q109367.fctr,Q113992.fctr,Q121699.fctr,Q121011.fctr,Q114748.fctr,Q106042.fctr,Q111220.fctr,Q114517.fctr,Q102687.fctr,Q102906.fctr,Q98078.fctr,Q115390.fctr,Q102089.fctr,Q100010.fctr,Q99982.fctr,Q113583.fctr,Q108342.fctr,Q104996.fctr,Q119650.fctr,Q100689.fctr,Q108617.fctr,Q115195.fctr,Q99716.fctr,Q101163.fctr,Q98059.fctr,Q114961.fctr,Hhold.fctr,Hhold.fctr:.clusterid.fctr,YOB.Age.fctr:YOB.Age.dff"
## Warning in myfit_mdl(mdl_specs_lst = myinit_mdl_specs_lst(mdl_specs_lst
## = list(id.prefix = bstMdlIdComponents$family, : myfit_mdl: preProcess
## method: range currently does not work for columns with no variance:
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff
## [1] "myfit_mdl: setup complete: 0.810000 secs"
## Warning in preProcess.default(method = "ica", n.comp = 3, x =
## structure(c(-0.480112420809766, : These variables have zero variances:
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff
## + Fold1.Rep1: alpha=0.100, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKn:.clusterid.fctr4,
## Hhold.fctrSKn:.clusterid.fctr4, Hhold.fctrSKy:.clusterid.fctr4,
## YOB.Age.fctrNA:YOB.Age.dff
## - Fold1.Rep1: alpha=0.100, lambda=0.02503 
## + Fold1.Rep1: alpha=0.325, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKn:.clusterid.fctr4,
## Hhold.fctrSKn:.clusterid.fctr4, Hhold.fctrSKy:.clusterid.fctr4,
## YOB.Age.fctrNA:YOB.Age.dff
## - Fold1.Rep1: alpha=0.325, lambda=0.02503 
## + Fold1.Rep1: alpha=0.550, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKn:.clusterid.fctr4,
## Hhold.fctrSKn:.clusterid.fctr4, Hhold.fctrSKy:.clusterid.fctr4,
## YOB.Age.fctrNA:YOB.Age.dff
## - Fold1.Rep1: alpha=0.550, lambda=0.02503 
## + Fold1.Rep1: alpha=0.775, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKn:.clusterid.fctr4,
## Hhold.fctrSKn:.clusterid.fctr4, Hhold.fctrSKy:.clusterid.fctr4,
## YOB.Age.fctrNA:YOB.Age.dff
## - Fold1.Rep1: alpha=0.775, lambda=0.02503 
## + Fold1.Rep1: alpha=1.000, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKn:.clusterid.fctr4,
## Hhold.fctrSKn:.clusterid.fctr4, Hhold.fctrSKy:.clusterid.fctr4,
## YOB.Age.fctrNA:YOB.Age.dff
## - Fold1.Rep1: alpha=1.000, lambda=0.02503 
## + Fold2.Rep1: alpha=0.100, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKy:.clusterid.fctr2,
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrPKy:.clusterid.fctr4,
## Hhold.fctrSKn:.clusterid.fctr4, Hhold.fctrSKy:.clusterid.fctr4,
## YOB.Age.fctrNA:YOB.Age.dff
## - Fold2.Rep1: alpha=0.100, lambda=0.02503 
## + Fold2.Rep1: alpha=0.325, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKy:.clusterid.fctr2,
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrPKy:.clusterid.fctr4,
## Hhold.fctrSKn:.clusterid.fctr4, Hhold.fctrSKy:.clusterid.fctr4,
## YOB.Age.fctrNA:YOB.Age.dff
## - Fold2.Rep1: alpha=0.325, lambda=0.02503 
## + Fold2.Rep1: alpha=0.550, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKy:.clusterid.fctr2,
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrPKy:.clusterid.fctr4,
## Hhold.fctrSKn:.clusterid.fctr4, Hhold.fctrSKy:.clusterid.fctr4,
## YOB.Age.fctrNA:YOB.Age.dff
## - Fold2.Rep1: alpha=0.550, lambda=0.02503 
## + Fold2.Rep1: alpha=0.775, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKy:.clusterid.fctr2,
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrPKy:.clusterid.fctr4,
## Hhold.fctrSKn:.clusterid.fctr4, Hhold.fctrSKy:.clusterid.fctr4,
## YOB.Age.fctrNA:YOB.Age.dff
## - Fold2.Rep1: alpha=0.775, lambda=0.02503 
## + Fold2.Rep1: alpha=1.000, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKy:.clusterid.fctr2,
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrPKy:.clusterid.fctr4,
## Hhold.fctrSKn:.clusterid.fctr4, Hhold.fctrSKy:.clusterid.fctr4,
## YOB.Age.fctrNA:YOB.Age.dff
## - Fold2.Rep1: alpha=1.000, lambda=0.02503 
## + Fold3.Rep1: alpha=0.100, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKy:.clusterid.fctr3,
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff
## - Fold3.Rep1: alpha=0.100, lambda=0.02503 
## + Fold3.Rep1: alpha=0.325, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKy:.clusterid.fctr3,
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff
## - Fold3.Rep1: alpha=0.325, lambda=0.02503 
## + Fold3.Rep1: alpha=0.550, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKy:.clusterid.fctr3,
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff
## - Fold3.Rep1: alpha=0.550, lambda=0.02503 
## + Fold3.Rep1: alpha=0.775, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKy:.clusterid.fctr3,
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff
## - Fold3.Rep1: alpha=0.775, lambda=0.02503 
## + Fold3.Rep1: alpha=1.000, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKy:.clusterid.fctr3,
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff
## - Fold3.Rep1: alpha=1.000, lambda=0.02503 
## + Fold1.Rep2: alpha=0.100, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKn:.clusterid.fctr4,
## Hhold.fctrSKn:.clusterid.fctr4, Hhold.fctrSKy:.clusterid.fctr4,
## YOB.Age.fctrNA:YOB.Age.dff
## - Fold1.Rep2: alpha=0.100, lambda=0.02503 
## + Fold1.Rep2: alpha=0.325, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKn:.clusterid.fctr4,
## Hhold.fctrSKn:.clusterid.fctr4, Hhold.fctrSKy:.clusterid.fctr4,
## YOB.Age.fctrNA:YOB.Age.dff
## - Fold1.Rep2: alpha=0.325, lambda=0.02503 
## + Fold1.Rep2: alpha=0.550, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKn:.clusterid.fctr4,
## Hhold.fctrSKn:.clusterid.fctr4, Hhold.fctrSKy:.clusterid.fctr4,
## YOB.Age.fctrNA:YOB.Age.dff
## - Fold1.Rep2: alpha=0.550, lambda=0.02503 
## + Fold1.Rep2: alpha=0.775, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKn:.clusterid.fctr4,
## Hhold.fctrSKn:.clusterid.fctr4, Hhold.fctrSKy:.clusterid.fctr4,
## YOB.Age.fctrNA:YOB.Age.dff
## - Fold1.Rep2: alpha=0.775, lambda=0.02503 
## + Fold1.Rep2: alpha=1.000, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKn:.clusterid.fctr4,
## Hhold.fctrSKn:.clusterid.fctr4, Hhold.fctrSKy:.clusterid.fctr4,
## YOB.Age.fctrNA:YOB.Age.dff
## - Fold1.Rep2: alpha=1.000, lambda=0.02503 
## + Fold2.Rep2: alpha=0.100, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKy:.clusterid.fctr3,
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff
## - Fold2.Rep2: alpha=0.100, lambda=0.02503 
## + Fold2.Rep2: alpha=0.325, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKy:.clusterid.fctr3,
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff
## - Fold2.Rep2: alpha=0.325, lambda=0.02503 
## + Fold2.Rep2: alpha=0.550, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKy:.clusterid.fctr3,
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff
## - Fold2.Rep2: alpha=0.550, lambda=0.02503 
## + Fold2.Rep2: alpha=0.775, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKy:.clusterid.fctr3,
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff
## - Fold2.Rep2: alpha=0.775, lambda=0.02503 
## + Fold2.Rep2: alpha=1.000, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKy:.clusterid.fctr3,
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff
## - Fold2.Rep2: alpha=1.000, lambda=0.02503 
## + Fold3.Rep2: alpha=0.100, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKy:.clusterid.fctr2,
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff
## - Fold3.Rep2: alpha=0.100, lambda=0.02503 
## + Fold3.Rep2: alpha=0.325, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKy:.clusterid.fctr2,
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff
## - Fold3.Rep2: alpha=0.325, lambda=0.02503 
## + Fold3.Rep2: alpha=0.550, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKy:.clusterid.fctr2,
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff
## - Fold3.Rep2: alpha=0.550, lambda=0.02503 
## + Fold3.Rep2: alpha=0.775, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKy:.clusterid.fctr2,
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff
## - Fold3.Rep2: alpha=0.775, lambda=0.02503 
## + Fold3.Rep2: alpha=1.000, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKy:.clusterid.fctr2,
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff
## - Fold3.Rep2: alpha=1.000, lambda=0.02503 
## + Fold1.Rep3: alpha=0.100, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKy:.clusterid.fctr2,
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff
## - Fold1.Rep3: alpha=0.100, lambda=0.02503 
## + Fold1.Rep3: alpha=0.325, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKy:.clusterid.fctr2,
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff
## - Fold1.Rep3: alpha=0.325, lambda=0.02503 
## + Fold1.Rep3: alpha=0.550, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKy:.clusterid.fctr2,
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff
## - Fold1.Rep3: alpha=0.550, lambda=0.02503 
## + Fold1.Rep3: alpha=0.775, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKy:.clusterid.fctr2,
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff
## - Fold1.Rep3: alpha=0.775, lambda=0.02503 
## + Fold1.Rep3: alpha=1.000, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKy:.clusterid.fctr2,
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff
## - Fold1.Rep3: alpha=1.000, lambda=0.02503 
## + Fold2.Rep3: alpha=0.100, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKn:.clusterid.fctr4,
## Hhold.fctrSKn:.clusterid.fctr4, Hhold.fctrSKy:.clusterid.fctr4,
## YOB.Age.fctrNA:YOB.Age.dff
## - Fold2.Rep3: alpha=0.100, lambda=0.02503 
## + Fold2.Rep3: alpha=0.325, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKn:.clusterid.fctr4,
## Hhold.fctrSKn:.clusterid.fctr4, Hhold.fctrSKy:.clusterid.fctr4,
## YOB.Age.fctrNA:YOB.Age.dff
## - Fold2.Rep3: alpha=0.325, lambda=0.02503 
## + Fold2.Rep3: alpha=0.550, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKn:.clusterid.fctr4,
## Hhold.fctrSKn:.clusterid.fctr4, Hhold.fctrSKy:.clusterid.fctr4,
## YOB.Age.fctrNA:YOB.Age.dff
## - Fold2.Rep3: alpha=0.550, lambda=0.02503 
## + Fold2.Rep3: alpha=0.775, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKn:.clusterid.fctr4,
## Hhold.fctrSKn:.clusterid.fctr4, Hhold.fctrSKy:.clusterid.fctr4,
## YOB.Age.fctrNA:YOB.Age.dff
## - Fold2.Rep3: alpha=0.775, lambda=0.02503 
## + Fold2.Rep3: alpha=1.000, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKn:.clusterid.fctr4,
## Hhold.fctrSKn:.clusterid.fctr4, Hhold.fctrSKy:.clusterid.fctr4,
## YOB.Age.fctrNA:YOB.Age.dff
## - Fold2.Rep3: alpha=1.000, lambda=0.02503 
## + Fold3.Rep3: alpha=0.100, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKy:.clusterid.fctr3,
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff
## - Fold3.Rep3: alpha=0.100, lambda=0.02503 
## + Fold3.Rep3: alpha=0.325, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKy:.clusterid.fctr3,
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff
## - Fold3.Rep3: alpha=0.325, lambda=0.02503 
## + Fold3.Rep3: alpha=0.550, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKy:.clusterid.fctr3,
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff
## - Fold3.Rep3: alpha=0.550, lambda=0.02503 
## + Fold3.Rep3: alpha=0.775, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKy:.clusterid.fctr3,
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff
## - Fold3.Rep3: alpha=0.775, lambda=0.02503 
## + Fold3.Rep3: alpha=1.000, lambda=0.02503
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKy:.clusterid.fctr3,
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff
## - Fold3.Rep3: alpha=1.000, lambda=0.02503 
## Aggregating results
## Selecting tuning parameters
## Fitting alpha = 0.55, lambda = 0.00539 on full training set
## Warning in preProcess.default(thresh = 0.95, k = 5, method = "ica", n.comp
## = 3, : These variables have zero variances: Hhold.fctrPKn:.clusterid.fctr4,
## Hhold.fctrSKn:.clusterid.fctr4, Hhold.fctrSKy:.clusterid.fctr4,
## YOB.Age.fctrNA:YOB.Age.dff

## [1] "myfit_mdl: train complete: 23.741000 secs"

##             Length Class      Mode     
## a0           37    -none-     numeric  
## beta        111    dgCMatrix  S4       
## df           37    -none-     numeric  
## dim           2    -none-     numeric  
## lambda       37    -none-     numeric  
## dev.ratio    37    -none-     numeric  
## nulldev       1    -none-     numeric  
## npasses       1    -none-     numeric  
## jerr          1    -none-     numeric  
## offset        1    -none-     logical  
## classnames    2    -none-     character
## call          5    -none-     call     
## nobs          1    -none-     numeric  
## lambdaOpt     1    -none-     numeric  
## xNames        3    -none-     character
## problemType   1    -none-     character
## tuneValue     2    data.frame list     
## obsLevels     2    -none-     character
## [1] "min lambda > lambdaOpt:"
##  (Intercept)         ICA1         ICA2         ICA3 
##  0.324410558  0.161623052 -0.226049140 -0.001036744 
## [1] "max lambda < lambdaOpt:"
##  (Intercept)         ICA1         ICA2         ICA3 
##  0.324501947  0.163025559 -0.227524076 -0.002238236 
## [1] "myfit_mdl: train diagnostics complete: 24.306000 secs"

##          Prediction
## Reference    D    R
##         D  135  689
##         R  103 1030
##       Accuracy          Kappa  AccuracyLower  AccuracyUpper   AccuracyNull 
##   5.952989e-01   8.075748e-02   5.731676e-01   6.171443e-01   5.789474e-01 
## AccuracyPValue  McnemarPValue 
##   7.442809e-02   5.666712e-96

##          Prediction
## Reference   D   R
##         D   1 213
##         R   1 287
##       Accuracy          Kappa  AccuracyLower  AccuracyUpper   AccuracyNull 
##   5.737052e-01   1.375772e-03   5.291204e-01   6.174170e-01   5.737052e-01 
## AccuracyPValue  McnemarPValue 
##   5.188758e-01   3.673187e-47 
## [1] "myfit_mdl: predict complete: 33.939000 secs"
##                     id
## 1 All.X#ica#rcv#glmnet
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           feats
## 1 Q115611.fctr,Q113181.fctr,Q98197.fctr,Q116881.fctr,Q108855.fctr,Q106272.fctr,Q122771.fctr,Q123621.fctr,Q106388.fctr,Q110740.fctr,Q122769.fctr,Q120472.fctr,Q101596.fctr,Q119334.fctr,Q114152.fctr,Q98869.fctr,Q115899.fctr,Q116797.fctr,Q118232.fctr,Gender.fctr,Q105655.fctr,Q99480.fctr,Q123464.fctr,Q120650.fctr,Q122120.fctr,Q107869.fctr,Q120014.fctr,Q102289.fctr,Income.fctr,Q122770.fctr,Q111580.fctr,Q116601.fctr,Q117186.fctr,Q106993.fctr,Q112270.fctr,Q101162.fctr,Q108856.fctr,Q117193.fctr,Q116441.fctr,Q119851.fctr,Q111848.fctr,Q98578.fctr,Q118892.fctr,Q114386.fctr,Q120978.fctr,Q112512.fctr,Q102674.fctr,Q96024.fctr,Q108950.fctr,Q115610.fctr,YOB.Age.fctr,Q112478.fctr,Q116197.fctr,Q124742.fctr,Q106389.fctr,Edn.fctr,Q118117.fctr,Q100562.fctr,Q107491.fctr,Q116448.fctr,Q108754.fctr,Q116953.fctr,Q115602.fctr,Q118233.fctr,Q120012.fctr,Q118237.fctr,Q99581.fctr,.rnorm,Q120194.fctr,Q115777.fctr,Q106997.fctr,Q100680.fctr,Q113584.fctr,Q108343.fctr,Q121700.fctr,Q105840.fctr,Q120379.fctr,Q103293.fctr,Q124122.fctr,Q109367.fctr,Q113992.fctr,Q121699.fctr,Q121011.fctr,Q114748.fctr,Q106042.fctr,Q111220.fctr,Q114517.fctr,Q102687.fctr,Q102906.fctr,Q98078.fctr,Q115390.fctr,Q102089.fctr,Q100010.fctr,Q99982.fctr,Q113583.fctr,Q108342.fctr,Q104996.fctr,Q119650.fctr,Q100689.fctr,Q108617.fctr,Q115195.fctr,Q99716.fctr,Q101163.fctr,Q98059.fctr,Q114961.fctr,Hhold.fctr,Hhold.fctr:.clusterid.fctr,YOB.Age.fctr:YOB.Age.dff
##   max.nTuningRuns min.elapsedtime.everything min.elapsedtime.final
## 1              15                     22.835                 0.469
##   max.AUCpROC.fit max.Sens.fit max.Spec.fit max.AUCROCR.fit
## 1       0.5364629     0.163835    0.9090909       0.5849557
##   opt.prob.threshold.fit max.f.score.fit max.Accuracy.fit
## 1                    0.5       0.7223001        0.5918896
##   max.AccuracyLower.fit max.AccuracyUpper.fit max.Kappa.fit
## 1             0.5731676             0.6171443    0.07196172
##   max.AUCpROC.OOB max.Sens.OOB max.Spec.OOB max.AUCROCR.OOB
## 1       0.4820223    0.1168224    0.8472222       0.5297573
##   opt.prob.threshold.OOB max.f.score.OOB max.Accuracy.OOB
## 1                    0.4       0.7284264        0.5737052
##   max.AccuracyLower.OOB max.AccuracyUpper.OOB max.Kappa.OOB
## 1             0.5291204              0.617417   0.001375772
##   max.AccuracySD.fit max.KappaSD.fit
## 1        0.008635588       0.0194654
## [1] "myfit_mdl: exit: 34.332000 secs"
## [1] "myfit_mdl: enter: 0.001000 secs"
## [1] "myfit_mdl: fitting model: All.X#spatialSign#rcv#glmnet"
## [1] "    indepVar: Q115611.fctr,Q113181.fctr,Q98197.fctr,Q116881.fctr,Q108855.fctr,Q106272.fctr,Q122771.fctr,Q123621.fctr,Q106388.fctr,Q110740.fctr,Q122769.fctr,Q120472.fctr,Q101596.fctr,Q119334.fctr,Q114152.fctr,Q98869.fctr,Q115899.fctr,Q116797.fctr,Q118232.fctr,Gender.fctr,Q105655.fctr,Q99480.fctr,Q123464.fctr,Q120650.fctr,Q122120.fctr,Q107869.fctr,Q120014.fctr,Q102289.fctr,Income.fctr,Q122770.fctr,Q111580.fctr,Q116601.fctr,Q117186.fctr,Q106993.fctr,Q112270.fctr,Q101162.fctr,Q108856.fctr,Q117193.fctr,Q116441.fctr,Q119851.fctr,Q111848.fctr,Q98578.fctr,Q118892.fctr,Q114386.fctr,Q120978.fctr,Q112512.fctr,Q102674.fctr,Q96024.fctr,Q108950.fctr,Q115610.fctr,YOB.Age.fctr,Q112478.fctr,Q116197.fctr,Q124742.fctr,Q106389.fctr,Edn.fctr,Q118117.fctr,Q100562.fctr,Q107491.fctr,Q116448.fctr,Q108754.fctr,Q116953.fctr,Q115602.fctr,Q118233.fctr,Q120012.fctr,Q118237.fctr,Q99581.fctr,.rnorm,Q120194.fctr,Q115777.fctr,Q106997.fctr,Q100680.fctr,Q113584.fctr,Q108343.fctr,Q121700.fctr,Q105840.fctr,Q120379.fctr,Q103293.fctr,Q124122.fctr,Q109367.fctr,Q113992.fctr,Q121699.fctr,Q121011.fctr,Q114748.fctr,Q106042.fctr,Q111220.fctr,Q114517.fctr,Q102687.fctr,Q102906.fctr,Q98078.fctr,Q115390.fctr,Q102089.fctr,Q100010.fctr,Q99982.fctr,Q113583.fctr,Q108342.fctr,Q104996.fctr,Q119650.fctr,Q100689.fctr,Q108617.fctr,Q115195.fctr,Q99716.fctr,Q101163.fctr,Q98059.fctr,Q114961.fctr,Hhold.fctr,Hhold.fctr:.clusterid.fctr,YOB.Age.fctr:YOB.Age.dff"
## [1] "myfit_mdl: setup complete: 0.692000 secs"
## Warning in preProcess.default(method = "spatialSign", x =
## structure(c(-0.480112420809766, : These variables have zero variances:
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff
## Aggregating results
## Selecting tuning parameters
## Fitting alpha = 0.325, lambda = 0.0335 on full training set
## Warning in preProcess.default(thresh = 0.95, k = 5, method
## = "spatialSign", : These variables have zero variances:
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff

## [1] "myfit_mdl: train complete: 21.317000 secs"
## Warning in myfit_mdl(mdl_specs_lst = myinit_mdl_specs_lst(mdl_specs_lst =
## list(id.prefix = bstMdlIdComponents$family, : model's bestTune found at an
## extreme of tuneGrid for parameter: lambda

##             Length Class      Mode     
## a0             84  -none-     numeric  
## beta        21840  dgCMatrix  S4       
## df             84  -none-     numeric  
## dim             2  -none-     numeric  
## lambda         84  -none-     numeric  
## dev.ratio      84  -none-     numeric  
## nulldev         1  -none-     numeric  
## npasses         1  -none-     numeric  
## jerr            1  -none-     numeric  
## offset          1  -none-     logical  
## classnames      2  -none-     character
## call            5  -none-     call     
## nobs            1  -none-     numeric  
## lambdaOpt       1  -none-     numeric  
## xNames        260  -none-     character
## problemType     1  -none-     character
## tuneValue       2  data.frame list     
## obsLevels       2  -none-     character
## [1] "min lambda > lambdaOpt:"
##                     (Intercept)                   Hhold.fctrMKy 
##                      0.32741793                      0.75040355 
##                   Hhold.fctrPKn                   Hhold.fctrPKy 
##                     -1.68803724                     -1.24808973 
##                   Hhold.fctrSKy                   Income.fctr.Q 
##                     -0.39315414                      0.50164688 
##                   Income.fctr.C                   Income.fctr^6 
##                      0.68731976                     -0.41910686 
##                  Q100562.fctrNo                 Q100689.fctrYes 
##                     -0.60162473                     -0.10679590 
##                 Q101163.fctrDad                 Q102089.fctrOwn 
##                      1.24090131                      0.23282600 
##                 Q104996.fctrYes                 Q105655.fctrYes 
##                     -0.46673055                      0.74393721 
##                  Q106272.fctrNo                 Q106272.fctrYes 
##                     -0.71986043                      0.02087179 
##                 Q106388.fctrYes                  Q106997.fctrGr 
##                      0.02035863                      1.33529126 
##                  Q106997.fctrYy              Q108855.fctrUmm... 
##                     -0.03427569                     -0.41928096 
##                Q108855.fctrYes!                  Q109367.fctrNo 
##                      0.06592898                      0.56344697 
##                 Q109367.fctrYes                  Q110740.fctrPC 
##                     -0.20909832                      0.42052728 
##                  Q112512.fctrNo                  Q113181.fctrNo 
##                     -0.05234640                     -2.08828558 
##                 Q113181.fctrYes          Q114386.fctrMysterious 
##                      0.72459505                     -0.33142096 
##                  Q114517.fctrNo                  Q115390.fctrNo 
##                     -0.73064059                      0.04160894 
##                  Q115611.fctrNo                 Q115611.fctrYes 
##                     -0.67735622                      2.24911631 
##                  Q115899.fctrCs                  Q116601.fctrNo 
##                     -0.46697668                     -0.26072188 
##               Q116881.fctrHappy               Q116881.fctrRight 
##                     -0.46152051                      1.40387104 
##                  Q116953.fctrNo      Q117193.fctrStandard hours 
##                      0.39505452                      0.23335091 
##                  Q118892.fctrNo              Q119650.fctrGiving 
##                     -0.54623480                      0.89295237 
##         Q120194.fctrStudy first                 Q120379.fctrYes 
##                     -0.01261912                     -0.26652882 
##             Q120472.fctrScience                 Q122769.fctrYes 
##                      0.53767804                      0.18597159 
##                  Q122771.fctrPt                 Q123464.fctrYes 
##                      0.08719323                      0.04157432 
##                 Q123621.fctrYes                  Q124742.fctrNo 
##                      0.58861333                     -0.88733674 
##                   Q96024.fctrNo                   Q98197.fctrNo 
##                     -0.09013602                     -1.15603900 
##                   Q98869.fctrNo                   Q99480.fctrNo 
##                     -1.22932412                     -1.22813909 
##                  Q99480.fctrYes                  Q99716.fctrYes 
##                      0.03457696                     -0.41488311 
##  Hhold.fctrPKy:.clusterid.fctr2  Hhold.fctrSKn:.clusterid.fctr2 
##                     -0.15159512                      0.39750663 
##  Hhold.fctrSKy:.clusterid.fctr3    Hhold.fctrN:.clusterid.fctr4 
##                     -0.39921752                      0.44480242 
##  Hhold.fctrMKy:.clusterid.fctr4  Hhold.fctrPKy:.clusterid.fctr4 
##                      0.40341565                      0.86413578 
## YOB.Age.fctr(25,30]:YOB.Age.dff YOB.Age.fctr(35,40]:YOB.Age.dff 
##                      0.25949987                     -0.50116421 
## YOB.Age.fctr(40,50]:YOB.Age.dff 
##                      0.01479411 
## [1] "max lambda < lambdaOpt:"
##                     (Intercept)                   Hhold.fctrMKy 
##                     0.328268741                     0.773064515 
##                   Hhold.fctrPKn                   Hhold.fctrPKy 
##                    -1.754199338                    -1.350737217 
##                   Hhold.fctrSKy                   Income.fctr.Q 
##                    -0.441914384                     0.555393842 
##                   Income.fctr.C                   Income.fctr^6 
##                     0.788045928                    -0.488125918 
##                  Q100562.fctrNo                 Q100689.fctrYes 
##                    -0.662579987                    -0.202109638 
##                 Q101163.fctrDad                 Q102089.fctrOwn 
##                     1.302141218                     0.295146239 
##                 Q104996.fctrYes                 Q105655.fctrYes 
##                    -0.559569453                     0.811109328 
##                 Q106042.fctrYes                  Q106272.fctrNo 
##                    -0.011659886                    -0.765322248 
##                 Q106272.fctrYes                 Q106388.fctrYes 
##                     0.029703741                     0.053843276 
##                  Q106997.fctrGr                  Q106997.fctrYy 
##                     1.417343736                    -0.084644905 
##              Q108855.fctrUmm...                Q108855.fctrYes! 
##                    -0.484733387                     0.070467853 
##                  Q109367.fctrNo                 Q109367.fctrYes 
##                     0.613756577                    -0.223817695 
##                  Q110740.fctrPC                 Q111220.fctrYes 
##                     0.471033230                    -0.010983636 
##                  Q112512.fctrNo                  Q113181.fctrNo 
##                    -0.120100015                    -2.124905356 
##                 Q113181.fctrYes          Q114386.fctrMysterious 
##                     0.707447643                    -0.415622365 
##                  Q114517.fctrNo                  Q115390.fctrNo 
##                    -0.815549766                     0.105571424 
##                  Q115611.fctrNo                 Q115611.fctrYes 
##                    -0.650541496                     2.319240433 
##                 Q115777.fctrEnd                  Q115899.fctrCs 
##                     0.007412728                    -0.525282462 
##                  Q116601.fctrNo               Q116881.fctrHappy 
##                    -0.325008618                    -0.512633753 
##               Q116881.fctrRight                  Q116953.fctrNo 
##                     1.430922885                     0.452515847 
##           Q117193.fctrOdd hours      Q117193.fctrStandard hours 
##                    -0.010881333                     0.305239616 
##                  Q118892.fctrNo              Q119650.fctrGiving 
##                    -0.638869856                     0.974839975 
##         Q120194.fctrStudy first                 Q120379.fctrYes 
##                    -0.073269669                    -0.355098823 
##             Q120472.fctrScience                 Q122120.fctrYes 
##                     0.618395258                     0.026313287 
##                 Q122769.fctrYes                  Q122771.fctrPt 
##                     0.239529477                     0.139789989 
##                 Q123464.fctrYes                 Q123621.fctrYes 
##                     0.138830158                     0.630236393 
##                  Q124742.fctrNo                   Q96024.fctrNo 
##                    -0.970287555                    -0.117362646 
##                   Q98197.fctrNo                   Q98869.fctrNo 
##                    -1.183603057                    -1.269889599 
##                   Q99480.fctrNo                  Q99480.fctrYes 
##                    -1.250853132                     0.079564926 
##                  Q99716.fctrYes  Hhold.fctrPKn:.clusterid.fctr2 
##                    -0.476464808                    -0.011937211 
##  Hhold.fctrPKy:.clusterid.fctr2  Hhold.fctrSKn:.clusterid.fctr2 
##                    -0.306251542                     0.465752126 
##  Hhold.fctrPKy:.clusterid.fctr3  Hhold.fctrSKy:.clusterid.fctr3 
##                    -0.112831248                    -0.463706172 
##    Hhold.fctrN:.clusterid.fctr4  Hhold.fctrMKy:.clusterid.fctr4 
##                     0.528769413                     0.458820976 
##  Hhold.fctrPKy:.clusterid.fctr4 YOB.Age.fctr(25,30]:YOB.Age.dff 
##                     1.052043670                     0.338048742 
## YOB.Age.fctr(35,40]:YOB.Age.dff YOB.Age.fctr(40,50]:YOB.Age.dff 
##                    -0.558975675                     0.069307316 
## [1] "myfit_mdl: train diagnostics complete: 21.961000 secs"

##          Prediction
## Reference   D   R
##         D 459 365
##         R 296 837
##       Accuracy          Kappa  AccuracyLower  AccuracyUpper   AccuracyNull 
##   6.622381e-01   2.992021e-01   6.407976e-01   6.831914e-01   5.789474e-01 
## AccuracyPValue  McnemarPValue 
##   2.627869e-14   8.171664e-03

##          Prediction
## Reference   D   R
##         D  45 169
##         R  35 253
##       Accuracy          Kappa  AccuracyLower  AccuracyUpper   AccuracyNull 
##   5.936255e-01   9.651692e-02   5.492170e-01   6.369249e-01   5.737052e-01 
## AccuracyPValue  McnemarPValue 
##   1.957903e-01   1.256100e-20 
## [1] "myfit_mdl: predict complete: 32.675000 secs"
##                             id
## 1 All.X#spatialSign#rcv#glmnet
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           feats
## 1 Q115611.fctr,Q113181.fctr,Q98197.fctr,Q116881.fctr,Q108855.fctr,Q106272.fctr,Q122771.fctr,Q123621.fctr,Q106388.fctr,Q110740.fctr,Q122769.fctr,Q120472.fctr,Q101596.fctr,Q119334.fctr,Q114152.fctr,Q98869.fctr,Q115899.fctr,Q116797.fctr,Q118232.fctr,Gender.fctr,Q105655.fctr,Q99480.fctr,Q123464.fctr,Q120650.fctr,Q122120.fctr,Q107869.fctr,Q120014.fctr,Q102289.fctr,Income.fctr,Q122770.fctr,Q111580.fctr,Q116601.fctr,Q117186.fctr,Q106993.fctr,Q112270.fctr,Q101162.fctr,Q108856.fctr,Q117193.fctr,Q116441.fctr,Q119851.fctr,Q111848.fctr,Q98578.fctr,Q118892.fctr,Q114386.fctr,Q120978.fctr,Q112512.fctr,Q102674.fctr,Q96024.fctr,Q108950.fctr,Q115610.fctr,YOB.Age.fctr,Q112478.fctr,Q116197.fctr,Q124742.fctr,Q106389.fctr,Edn.fctr,Q118117.fctr,Q100562.fctr,Q107491.fctr,Q116448.fctr,Q108754.fctr,Q116953.fctr,Q115602.fctr,Q118233.fctr,Q120012.fctr,Q118237.fctr,Q99581.fctr,.rnorm,Q120194.fctr,Q115777.fctr,Q106997.fctr,Q100680.fctr,Q113584.fctr,Q108343.fctr,Q121700.fctr,Q105840.fctr,Q120379.fctr,Q103293.fctr,Q124122.fctr,Q109367.fctr,Q113992.fctr,Q121699.fctr,Q121011.fctr,Q114748.fctr,Q106042.fctr,Q111220.fctr,Q114517.fctr,Q102687.fctr,Q102906.fctr,Q98078.fctr,Q115390.fctr,Q102089.fctr,Q100010.fctr,Q99982.fctr,Q113583.fctr,Q108342.fctr,Q104996.fctr,Q119650.fctr,Q100689.fctr,Q108617.fctr,Q115195.fctr,Q99716.fctr,Q101163.fctr,Q98059.fctr,Q114961.fctr,Hhold.fctr,Hhold.fctr:.clusterid.fctr,YOB.Age.fctr:YOB.Age.dff
##   max.nTuningRuns min.elapsedtime.everything min.elapsedtime.final
## 1              25                     20.544                 1.945
##   max.AUCpROC.fit max.Sens.fit max.Spec.fit max.AUCROCR.fit
## 1       0.6225728    0.4004854    0.8446602       0.6991673
##   opt.prob.threshold.fit max.f.score.fit max.Accuracy.fit
## 1                   0.55       0.7169165        0.6118257
##   max.AccuracyLower.fit max.AccuracyUpper.fit max.Kappa.fit
## 1             0.6407976             0.6831914     0.1628938
##   max.AUCpROC.OOB max.Sens.OOB max.Spec.OOB max.AUCROCR.OOB
## 1        0.555442    0.3504673    0.7604167       0.5704991
##   opt.prob.threshold.OOB max.f.score.OOB max.Accuracy.OOB
## 1                   0.45       0.7126761        0.5936255
##   max.AccuracyLower.OOB max.AccuracyUpper.OOB max.Kappa.OOB
## 1              0.549217             0.6369249    0.09651692
##   max.AccuracySD.fit max.KappaSD.fit
## 1        0.008616434      0.01531544
## [1] "myfit_mdl: exit: 33.429000 secs"
## [1] "myfit_mdl: enter: 0.000000 secs"
## [1] "myfit_mdl: fitting model: All.X#conditionalX#rcv#glmnet"
## [1] "    indepVar: Q115611.fctr,Q113181.fctr,Q98197.fctr,Q116881.fctr,Q108855.fctr,Q106272.fctr,Q122771.fctr,Q123621.fctr,Q106388.fctr,Q110740.fctr,Q122769.fctr,Q120472.fctr,Q101596.fctr,Q119334.fctr,Q114152.fctr,Q98869.fctr,Q115899.fctr,Q116797.fctr,Q118232.fctr,Gender.fctr,Q105655.fctr,Q99480.fctr,Q123464.fctr,Q120650.fctr,Q122120.fctr,Q107869.fctr,Q120014.fctr,Q102289.fctr,Income.fctr,Q122770.fctr,Q111580.fctr,Q116601.fctr,Q117186.fctr,Q106993.fctr,Q112270.fctr,Q101162.fctr,Q108856.fctr,Q117193.fctr,Q116441.fctr,Q119851.fctr,Q111848.fctr,Q98578.fctr,Q118892.fctr,Q114386.fctr,Q120978.fctr,Q112512.fctr,Q102674.fctr,Q96024.fctr,Q108950.fctr,Q115610.fctr,YOB.Age.fctr,Q112478.fctr,Q116197.fctr,Q124742.fctr,Q106389.fctr,Edn.fctr,Q118117.fctr,Q100562.fctr,Q107491.fctr,Q116448.fctr,Q108754.fctr,Q116953.fctr,Q115602.fctr,Q118233.fctr,Q120012.fctr,Q118237.fctr,Q99581.fctr,.rnorm,Q120194.fctr,Q115777.fctr,Q106997.fctr,Q100680.fctr,Q113584.fctr,Q108343.fctr,Q121700.fctr,Q105840.fctr,Q120379.fctr,Q103293.fctr,Q124122.fctr,Q109367.fctr,Q113992.fctr,Q121699.fctr,Q121011.fctr,Q114748.fctr,Q106042.fctr,Q111220.fctr,Q114517.fctr,Q102687.fctr,Q102906.fctr,Q98078.fctr,Q115390.fctr,Q102089.fctr,Q100010.fctr,Q99982.fctr,Q113583.fctr,Q108342.fctr,Q104996.fctr,Q119650.fctr,Q100689.fctr,Q108617.fctr,Q115195.fctr,Q99716.fctr,Q101163.fctr,Q98059.fctr,Q114961.fctr,Hhold.fctr,Hhold.fctr:.clusterid.fctr,YOB.Age.fctr:YOB.Age.dff"
## [1] "myfit_mdl: setup complete: 0.723000 secs"
## Aggregating results
## Selecting tuning parameters
## Fitting alpha = 0.325, lambda = 0.0333 on full training set
## [1] "myfit_mdl: train complete: 14.748000 secs"
## Warning in myfit_mdl(mdl_specs_lst = myinit_mdl_specs_lst(mdl_specs_lst =
## list(id.prefix = bstMdlIdComponents$family, : model's bestTune found at an
## extreme of tuneGrid for parameter: lambda

##             Length Class      Mode     
## a0             85  -none-     numeric  
## beta        22100  dgCMatrix  S4       
## df             85  -none-     numeric  
## dim             2  -none-     numeric  
## lambda         85  -none-     numeric  
## dev.ratio      85  -none-     numeric  
## nulldev         1  -none-     numeric  
## npasses         1  -none-     numeric  
## jerr            1  -none-     numeric  
## offset          1  -none-     logical  
## classnames      2  -none-     character
## call            5  -none-     call     
## nobs            1  -none-     numeric  
## lambdaOpt       1  -none-     numeric  
## xNames        260  -none-     character
## problemType     1  -none-     character
## tuneValue       2  data.frame list     
## obsLevels       2  -none-     character
## [1] "min lambda > lambdaOpt:"
##                     (Intercept)                   Hhold.fctrMKy 
##                    0.2689370104                    0.1223388126 
##                   Hhold.fctrPKn                   Hhold.fctrPKy 
##                   -0.5431418661                   -0.6618709561 
##                   Hhold.fctrSKy                   Income.fctr.Q 
##                   -0.1090177325                    0.0980362635 
##                   Income.fctr.C                   Income.fctr^6 
##                    0.1010397569                   -0.0558545740 
##                  Q100562.fctrNo                 Q100689.fctrYes 
##                   -0.1227211571                   -0.0242725337 
##                 Q101163.fctrDad                 Q102089.fctrOwn 
##                    0.1609136964                    0.0213110713 
##                 Q104996.fctrYes                 Q105655.fctrYes 
##                   -0.0733859891                    0.0994923204 
##                  Q106272.fctrNo                 Q106272.fctrYes 
##                   -0.0985282958                    0.0109728198 
##                 Q106388.fctrYes                  Q106997.fctrGr 
##                    0.0222597292                    0.1722153193 
##                  Q106997.fctrYy              Q108855.fctrUmm... 
##                   -0.0005482815                   -0.0640940960 
##                Q108855.fctrYes!                  Q109367.fctrNo 
##                    0.0043637645                    0.0776512027 
##                 Q109367.fctrYes                  Q110740.fctrPC 
##                   -0.0232319681                    0.0617129947 
##                  Q112512.fctrNo                  Q113181.fctrNo 
##                   -0.0089942731                   -0.2565348387 
##                 Q113181.fctrYes          Q114386.fctrMysterious 
##                    0.0883115008                   -0.0488277360 
##                  Q114517.fctrNo                  Q115390.fctrNo 
##                   -0.0891692654                    0.0037303385 
##                  Q115611.fctrNo                 Q115611.fctrYes 
##                   -0.0867549557                    0.2945956632 
##                  Q115899.fctrCs                  Q116601.fctrNo 
##                   -0.0700586145                   -0.0530411889 
##               Q116881.fctrHappy               Q116881.fctrRight 
##                   -0.0660674927                    0.2077280095 
##                  Q116953.fctrNo      Q117193.fctrStandard hours 
##                    0.0531229393                    0.0358169094 
##                  Q118892.fctrNo              Q119650.fctrGiving 
##                   -0.0768159368                    0.1151091086 
##         Q120194.fctrStudy first                 Q120379.fctrYes 
##                   -0.0034275168                   -0.0337302239 
##             Q120472.fctrScience                 Q122769.fctrYes 
##                    0.0750873634                    0.0270370204 
##                  Q122771.fctrPt                 Q123464.fctrYes 
##                    0.0093972520                    0.0018784552 
##                 Q123621.fctrYes                  Q124742.fctrNo 
##                    0.0702491183                   -0.1091270840 
##                   Q96024.fctrNo                   Q98197.fctrNo 
##                   -0.0097694988                   -0.1666944739 
##                   Q98869.fctrNo                   Q99480.fctrNo 
##                   -0.1988235708                   -0.1985567368 
##                  Q99480.fctrYes                  Q99716.fctrYes 
##                    0.0163095000                   -0.0848727311 
##  Hhold.fctrSKn:.clusterid.fctr2  Hhold.fctrSKy:.clusterid.fctr3 
##                    0.0972361315                   -0.2486718925 
##    Hhold.fctrN:.clusterid.fctr4  Hhold.fctrMKy:.clusterid.fctr4 
##                    0.2316323732                    0.0799692788 
##  Hhold.fctrPKy:.clusterid.fctr4 YOB.Age.fctr(25,30]:YOB.Age.dff 
##                    1.0850351271                    0.0174906316 
## YOB.Age.fctr(35,40]:YOB.Age.dff 
##                   -0.0338654783 
## [1] "max lambda < lambdaOpt:"
##                     (Intercept)                   Hhold.fctrMKy 
##                    0.2687574078                    0.1268980348 
##                   Hhold.fctrPKn                   Hhold.fctrPKy 
##                   -0.5667951509                   -0.7360179842 
##                   Hhold.fctrSKy                   Income.fctr.Q 
##                   -0.1223613415                    0.1076270135 
##                   Income.fctr.C                   Income.fctr^6 
##                    0.1181824886                   -0.0677662807 
##                  Q100562.fctrNo                 Q100689.fctrYes 
##                   -0.1336075822                   -0.0361502891 
##                 Q101163.fctrDad                 Q102089.fctrOwn 
##                    0.1686107441                    0.0295085694 
##                 Q104996.fctrYes                 Q105655.fctrYes 
##                   -0.0849702314                    0.1075000884 
##                  Q106272.fctrNo                 Q106272.fctrYes 
##                   -0.1055147182                    0.0127575171 
##                 Q106388.fctrYes                  Q106997.fctrGr 
##                    0.0276876095                    0.1820281443 
##                  Q106997.fctrYy              Q108855.fctrUmm... 
##                   -0.0075273343                   -0.0728898757 
##                Q108855.fctrYes!                  Q109367.fctrNo 
##                    0.0041288338                    0.0844117618 
##                 Q109367.fctrYes                  Q110740.fctrPC 
##                   -0.0244431062                    0.0676957492 
##                  Q112512.fctrNo                  Q113181.fctrNo 
##                   -0.0209172822                   -0.2616295419 
##                 Q113181.fctrYes          Q114386.fctrMysterious 
##                    0.0851082794                   -0.0595585781 
##                  Q114517.fctrNo                  Q115390.fctrNo 
##                   -0.1000702347                    0.0122548916 
##                  Q115611.fctrNo                 Q115611.fctrYes 
##                   -0.0839508900                    0.3033680414 
##                  Q115899.fctrCs                Q116197.fctrA.M. 
##                   -0.0787815553                    0.0025657763 
##                  Q116601.fctrNo               Q116881.fctrHappy 
##                   -0.0643774543                   -0.0725092183 
##               Q116881.fctrRight                  Q116953.fctrNo 
##                    0.2118371133                    0.0609143935 
##      Q117193.fctrStandard hours                 Q118233.fctrYes 
##                    0.0462755734                   -0.0004803217 
##                  Q118892.fctrNo              Q119650.fctrGiving 
##                   -0.0889319734                    0.1258648670 
##         Q120194.fctrStudy first                 Q120379.fctrYes 
##                   -0.0111318453                   -0.0460010967 
##             Q120472.fctrScience                 Q122120.fctrYes 
##                    0.0857212012                    0.0087862652 
##                 Q122769.fctrYes                  Q122771.fctrPt 
##                    0.0340947285                    0.0181767014 
##                 Q123464.fctrYes                 Q123621.fctrYes 
##                    0.0299377349                    0.0757128321 
##                  Q124742.fctrNo                   Q96024.fctrNo 
##                   -0.1201268773                   -0.0136151428 
##                  Q98059.fctrYes                   Q98197.fctrNo 
##                   -0.0008977055                   -0.1704429347 
##                   Q98869.fctrNo                   Q99480.fctrNo 
##                   -0.2057924299                   -0.2024638922 
##                  Q99480.fctrYes                  Q99716.fctrYes 
##                    0.0226409850                   -0.0981662351 
##  Hhold.fctrPKy:.clusterid.fctr2  Hhold.fctrSKn:.clusterid.fctr2 
##                   -0.0058086382                    0.1098872900 
##  Hhold.fctrSKy:.clusterid.fctr3    Hhold.fctrN:.clusterid.fctr4 
##                   -0.2880193501                    0.2766211491 
##  Hhold.fctrMKy:.clusterid.fctr4  Hhold.fctrPKy:.clusterid.fctr4 
##                    0.0932839092                    1.2878098547 
## YOB.Age.fctr(25,30]:YOB.Age.dff YOB.Age.fctr(35,40]:YOB.Age.dff 
##                    0.0216901093                   -0.0381595075 
## [1] "myfit_mdl: train diagnostics complete: 15.401000 secs"

##          Prediction
## Reference   D   R
##         D 461 363
##         R 295 838
##       Accuracy          Kappa  AccuracyLower  AccuracyUpper   AccuracyNull 
##   6.637711e-01   3.024994e-01   6.423517e-01   6.846987e-01   5.789474e-01 
## AccuracyPValue  McnemarPValue 
##   8.843720e-15   9.003218e-03

## [1] "mypredict_mdl: maxMetricDf:"
##    threshold   f.score  accuracy
## 10      0.45 0.7078652 0.5856574
## 11      0.50 0.6780186 0.5856574
##          Prediction
## Reference   D   R
##         D  75 139
##         R  69 219
##       Accuracy          Kappa  AccuracyLower  AccuracyUpper   AccuracyNull 
##   5.856574e-01   1.157481e-01   5.411697e-01   6.291304e-01   5.737052e-01 
## AccuracyPValue  McnemarPValue 
##   3.104270e-01   1.715935e-06 
## [1] "myfit_mdl: predict complete: 24.816000 secs"
##                              id
## 1 All.X#conditionalX#rcv#glmnet
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           feats
## 1 Q115611.fctr,Q113181.fctr,Q98197.fctr,Q116881.fctr,Q108855.fctr,Q106272.fctr,Q122771.fctr,Q123621.fctr,Q106388.fctr,Q110740.fctr,Q122769.fctr,Q120472.fctr,Q101596.fctr,Q119334.fctr,Q114152.fctr,Q98869.fctr,Q115899.fctr,Q116797.fctr,Q118232.fctr,Gender.fctr,Q105655.fctr,Q99480.fctr,Q123464.fctr,Q120650.fctr,Q122120.fctr,Q107869.fctr,Q120014.fctr,Q102289.fctr,Income.fctr,Q122770.fctr,Q111580.fctr,Q116601.fctr,Q117186.fctr,Q106993.fctr,Q112270.fctr,Q101162.fctr,Q108856.fctr,Q117193.fctr,Q116441.fctr,Q119851.fctr,Q111848.fctr,Q98578.fctr,Q118892.fctr,Q114386.fctr,Q120978.fctr,Q112512.fctr,Q102674.fctr,Q96024.fctr,Q108950.fctr,Q115610.fctr,YOB.Age.fctr,Q112478.fctr,Q116197.fctr,Q124742.fctr,Q106389.fctr,Edn.fctr,Q118117.fctr,Q100562.fctr,Q107491.fctr,Q116448.fctr,Q108754.fctr,Q116953.fctr,Q115602.fctr,Q118233.fctr,Q120012.fctr,Q118237.fctr,Q99581.fctr,.rnorm,Q120194.fctr,Q115777.fctr,Q106997.fctr,Q100680.fctr,Q113584.fctr,Q108343.fctr,Q121700.fctr,Q105840.fctr,Q120379.fctr,Q103293.fctr,Q124122.fctr,Q109367.fctr,Q113992.fctr,Q121699.fctr,Q121011.fctr,Q114748.fctr,Q106042.fctr,Q111220.fctr,Q114517.fctr,Q102687.fctr,Q102906.fctr,Q98078.fctr,Q115390.fctr,Q102089.fctr,Q100010.fctr,Q99982.fctr,Q113583.fctr,Q108342.fctr,Q104996.fctr,Q119650.fctr,Q100689.fctr,Q108617.fctr,Q115195.fctr,Q99716.fctr,Q101163.fctr,Q98059.fctr,Q114961.fctr,Hhold.fctr,Hhold.fctr:.clusterid.fctr,YOB.Age.fctr:YOB.Age.dff
##   max.nTuningRuns min.elapsedtime.everything min.elapsedtime.final
## 1              25                     13.941                 1.354
##   max.AUCpROC.fit max.Sens.fit max.Spec.fit max.AUCROCR.fit
## 1        0.621966    0.3992718    0.8446602        0.699893
##   opt.prob.threshold.fit max.f.score.fit max.Accuracy.fit
## 1                   0.55       0.7180805        0.6128487
##   max.AccuracyLower.fit max.AccuracyUpper.fit max.Kappa.fit
## 1             0.6423517             0.6846987     0.1649007
##   max.AUCpROC.OOB max.Sens.OOB max.Spec.OOB max.AUCROCR.OOB
## 1        0.555442    0.3504673    0.7604167       0.5688766
##   opt.prob.threshold.OOB max.f.score.OOB max.Accuracy.OOB
## 1                    0.5       0.6780186        0.5856574
##   max.AccuracyLower.OOB max.AccuracyUpper.OOB max.Kappa.OOB
## 1             0.5411697             0.6291304     0.1157481
##   max.AccuracySD.fit max.KappaSD.fit
## 1        0.009997796        0.019356
## [1] "myfit_mdl: exit: 25.098000 secs"
## [1] "myfit_mdl: enter: 0.001000 secs"
## [1] "myfit_mdl: fitting model: All.X#expoTrans.spatialSign#rcv#glmnet"
## [1] "    indepVar: Q115611.fctr,Q113181.fctr,Q98197.fctr,Q116881.fctr,Q108855.fctr,Q106272.fctr,Q122771.fctr,Q123621.fctr,Q106388.fctr,Q110740.fctr,Q122769.fctr,Q120472.fctr,Q101596.fctr,Q119334.fctr,Q114152.fctr,Q98869.fctr,Q115899.fctr,Q116797.fctr,Q118232.fctr,Gender.fctr,Q105655.fctr,Q99480.fctr,Q123464.fctr,Q120650.fctr,Q122120.fctr,Q107869.fctr,Q120014.fctr,Q102289.fctr,Income.fctr,Q122770.fctr,Q111580.fctr,Q116601.fctr,Q117186.fctr,Q106993.fctr,Q112270.fctr,Q101162.fctr,Q108856.fctr,Q117193.fctr,Q116441.fctr,Q119851.fctr,Q111848.fctr,Q98578.fctr,Q118892.fctr,Q114386.fctr,Q120978.fctr,Q112512.fctr,Q102674.fctr,Q96024.fctr,Q108950.fctr,Q115610.fctr,YOB.Age.fctr,Q112478.fctr,Q116197.fctr,Q124742.fctr,Q106389.fctr,Edn.fctr,Q118117.fctr,Q100562.fctr,Q107491.fctr,Q116448.fctr,Q108754.fctr,Q116953.fctr,Q115602.fctr,Q118233.fctr,Q120012.fctr,Q118237.fctr,Q99581.fctr,.rnorm,Q120194.fctr,Q115777.fctr,Q106997.fctr,Q100680.fctr,Q113584.fctr,Q108343.fctr,Q121700.fctr,Q105840.fctr,Q120379.fctr,Q103293.fctr,Q124122.fctr,Q109367.fctr,Q113992.fctr,Q121699.fctr,Q121011.fctr,Q114748.fctr,Q106042.fctr,Q111220.fctr,Q114517.fctr,Q102687.fctr,Q102906.fctr,Q98078.fctr,Q115390.fctr,Q102089.fctr,Q100010.fctr,Q99982.fctr,Q113583.fctr,Q108342.fctr,Q104996.fctr,Q119650.fctr,Q100689.fctr,Q108617.fctr,Q115195.fctr,Q99716.fctr,Q101163.fctr,Q98059.fctr,Q114961.fctr,Hhold.fctr,Hhold.fctr:.clusterid.fctr,YOB.Age.fctr:YOB.Age.dff"
## [1] "myfit_mdl: setup complete: 0.675000 secs"
## Aggregating results
## Selecting tuning parameters
## Fitting alpha = 0.325, lambda = 0.04 on full training set
## Warning in preProcess.default(thresh = 0.95, k = 5, method
## = c("expoTrans", : These variables have zero variances:
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff

## [1] "myfit_mdl: train complete: 43.669000 secs"

##             Length Class      Mode     
## a0             79  -none-     numeric  
## beta        20540  dgCMatrix  S4       
## df             79  -none-     numeric  
## dim             2  -none-     numeric  
## lambda         79  -none-     numeric  
## dev.ratio      79  -none-     numeric  
## nulldev         1  -none-     numeric  
## npasses         1  -none-     numeric  
## jerr            1  -none-     numeric  
## offset          1  -none-     logical  
## classnames      2  -none-     character
## call            5  -none-     call     
## nobs            1  -none-     numeric  
## lambdaOpt       1  -none-     numeric  
## xNames        260  -none-     character
## problemType     1  -none-     character
## tuneValue       2  data.frame list     
## obsLevels       2  -none-     character
## [1] "min lambda > lambdaOpt:"
##                     (Intercept)                   Hhold.fctrMKy 
##                      0.32563670                      0.67417135 
##                   Hhold.fctrPKn                   Hhold.fctrPKy 
##                     -1.51765112                     -1.00926836 
##                   Hhold.fctrSKy                   Income.fctr.Q 
##                     -0.29900806                      0.38478874 
##                   Income.fctr.C                   Income.fctr^6 
##                      0.47744021                     -0.28911304 
##                  Q100562.fctrNo                 Q101163.fctrDad 
##                     -0.44978648                      1.10959757 
##                 Q102089.fctrOwn                 Q104996.fctrYes 
##                      0.07119354                     -0.26171798 
##                 Q105655.fctrYes                  Q106272.fctrNo 
##                      0.58098456                     -0.59728552 
##                 Q106272.fctrYes                  Q106997.fctrGr 
##                      0.02000289                      1.11200127 
##              Q108855.fctrUmm...                Q108855.fctrYes! 
##                     -0.28416422                      0.02091655 
##                  Q109367.fctrNo                 Q109367.fctrYes 
##                      0.44364914                     -0.18111647 
##                  Q110740.fctrPC                  Q113181.fctrNo 
##                      0.33461099                     -2.01207020 
##                 Q113181.fctrYes          Q114386.fctrMysterious 
##                      0.79339863                     -0.14367961 
##                  Q114517.fctrNo                  Q115611.fctrNo 
##                     -0.53781586                     -0.72649007 
##                 Q115611.fctrYes                  Q115899.fctrCs 
##                      2.10532294                     -0.36322910 
##                  Q116601.fctrNo               Q116881.fctrHappy 
##                     -0.10759388                     -0.34200268 
##               Q116881.fctrRight                  Q116953.fctrNo 
##                      1.34181082                      0.24794394 
##      Q117193.fctrStandard hours                  Q118892.fctrNo 
##                      0.05548088                     -0.33766572 
##              Q119650.fctrGiving                 Q120379.fctrYes 
##                      0.74055045                     -0.09487587 
##             Q120472.fctrScience                 Q122769.fctrYes 
##                      0.38568585                      0.06424238 
##                 Q123621.fctrYes                  Q124742.fctrNo 
##                      0.50618397                     -0.70047580 
##                   Q96024.fctrNo                   Q98197.fctrNo 
##                     -0.01601521                     -1.08212986 
##                   Q98869.fctrNo                   Q99480.fctrNo 
##                     -1.13227248                     -1.15181799 
##                  Q99716.fctrYes  Hhold.fctrSKn:.clusterid.fctr2 
##                     -0.25270143                      0.22463433 
##  Hhold.fctrSKy:.clusterid.fctr3    Hhold.fctrN:.clusterid.fctr4 
##                     -0.28051155                      0.26037067 
##  Hhold.fctrMKy:.clusterid.fctr4  Hhold.fctrPKy:.clusterid.fctr4 
##                      0.26644698                      0.46446870 
## YOB.Age.fctr(35,40]:YOB.Age.dff 
##                     -0.30000777 
## [1] "max lambda < lambdaOpt:"
##                     (Intercept)                   Hhold.fctrMKy 
##                      0.32648800                      0.69999907 
##                   Hhold.fctrPKn                   Hhold.fctrPKy 
##                     -1.60262343                     -1.14119200 
##                   Hhold.fctrSKy                   Income.fctr.Q 
##                     -0.34796051                      0.44855063 
##                   Income.fctr.C                   Income.fctr^6 
##                      0.59138435                     -0.36089523 
##                  Q100562.fctrNo                 Q100689.fctrYes 
##                     -0.52448286                     -0.01610129 
##                 Q101163.fctrDad                 Q102089.fctrOwn 
##                      1.17485401                      0.13769817 
##                 Q104996.fctrYes                 Q105655.fctrYes 
##                     -0.35950450                      0.65713990 
##                  Q106272.fctrNo                 Q106272.fctrYes 
##                     -0.65886452                      0.01767484 
##                  Q106997.fctrGr              Q108855.fctrUmm... 
##                      1.25290537                     -0.35469685 
##                Q108855.fctrYes!                  Q109367.fctrNo 
##                      0.02948537                      0.49864382 
##                 Q109367.fctrYes                  Q110740.fctrPC 
##                     -0.20870630                      0.38193988 
##                  Q113181.fctrNo                 Q113181.fctrYes 
##                     -2.06595489                      0.76394504 
##          Q114386.fctrMysterious                  Q114517.fctrNo 
##                     -0.23375401                     -0.63310915 
##                  Q115611.fctrNo                 Q115611.fctrYes 
##                     -0.69706019                      2.18403976 
##                  Q115899.fctrCs                  Q116601.fctrNo 
##                     -0.42090548                     -0.17740915 
##               Q116881.fctrHappy               Q116881.fctrRight 
##                     -0.41194390                      1.36997009 
##                  Q116953.fctrNo      Q117193.fctrStandard hours 
##                      0.32079330                      0.14279251 
##                  Q118892.fctrNo              Q119650.fctrGiving 
##                     -0.43764433                      0.82189549 
##                 Q120379.fctrYes             Q120472.fctrScience 
##                     -0.19043021                      0.47147017 
##                 Q122769.fctrYes                  Q122771.fctrPt 
##                      0.12593502                      0.04493257 
##                 Q123621.fctrYes                  Q124742.fctrNo 
##                      0.55404281                     -0.79555372 
##                   Q96024.fctrNo                   Q98197.fctrNo 
##                     -0.05396074                     -1.11176387 
##                   Q98869.fctrNo                   Q99480.fctrNo 
##                     -1.18029542                     -1.20084890 
##                  Q99480.fctrYes                  Q99716.fctrYes 
##                      0.01670644                     -0.32158572 
##  Hhold.fctrSKn:.clusterid.fctr2  Hhold.fctrSKy:.clusterid.fctr3 
##                      0.30456203                     -0.35244350 
##    Hhold.fctrN:.clusterid.fctr4  Hhold.fctrMKy:.clusterid.fctr4 
##                      0.35723280                      0.32642053 
##  Hhold.fctrPKy:.clusterid.fctr4 YOB.Age.fctr(25,30]:YOB.Age.dff 
##                      0.67927816                      0.06154175 
## YOB.Age.fctr(35,40]:YOB.Age.dff YOB.Age.fctr(65,90]:YOB.Age.dff 
##                     -0.37803019                     -0.01726271 
## [1] "myfit_mdl: train diagnostics complete: 44.326000 secs"

##          Prediction
## Reference   D   R
##         D 440 384
##         R 300 833
##       Accuracy          Kappa  AccuracyLower  AccuracyUpper   AccuracyNull 
##   6.504854e-01   2.729917e-01   6.288914e-01   6.716276e-01   5.789474e-01 
## AccuracyPValue  McnemarPValue 
##   5.693857e-11   1.505692e-03

##          Prediction
## Reference   D   R
##         D  37 177
##         R  27 261
##       Accuracy          Kappa  AccuracyLower  AccuracyUpper   AccuracyNull 
##   5.936255e-01   8.697978e-02   5.492170e-01   6.369249e-01   5.737052e-01 
## AccuracyPValue  McnemarPValue 
##   1.957903e-01   1.769589e-25 
## [1] "myfit_mdl: predict complete: 54.789000 secs"
##                                       id
## 1 All.X#expoTrans.spatialSign#rcv#glmnet
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           feats
## 1 Q115611.fctr,Q113181.fctr,Q98197.fctr,Q116881.fctr,Q108855.fctr,Q106272.fctr,Q122771.fctr,Q123621.fctr,Q106388.fctr,Q110740.fctr,Q122769.fctr,Q120472.fctr,Q101596.fctr,Q119334.fctr,Q114152.fctr,Q98869.fctr,Q115899.fctr,Q116797.fctr,Q118232.fctr,Gender.fctr,Q105655.fctr,Q99480.fctr,Q123464.fctr,Q120650.fctr,Q122120.fctr,Q107869.fctr,Q120014.fctr,Q102289.fctr,Income.fctr,Q122770.fctr,Q111580.fctr,Q116601.fctr,Q117186.fctr,Q106993.fctr,Q112270.fctr,Q101162.fctr,Q108856.fctr,Q117193.fctr,Q116441.fctr,Q119851.fctr,Q111848.fctr,Q98578.fctr,Q118892.fctr,Q114386.fctr,Q120978.fctr,Q112512.fctr,Q102674.fctr,Q96024.fctr,Q108950.fctr,Q115610.fctr,YOB.Age.fctr,Q112478.fctr,Q116197.fctr,Q124742.fctr,Q106389.fctr,Edn.fctr,Q118117.fctr,Q100562.fctr,Q107491.fctr,Q116448.fctr,Q108754.fctr,Q116953.fctr,Q115602.fctr,Q118233.fctr,Q120012.fctr,Q118237.fctr,Q99581.fctr,.rnorm,Q120194.fctr,Q115777.fctr,Q106997.fctr,Q100680.fctr,Q113584.fctr,Q108343.fctr,Q121700.fctr,Q105840.fctr,Q120379.fctr,Q103293.fctr,Q124122.fctr,Q109367.fctr,Q113992.fctr,Q121699.fctr,Q121011.fctr,Q114748.fctr,Q106042.fctr,Q111220.fctr,Q114517.fctr,Q102687.fctr,Q102906.fctr,Q98078.fctr,Q115390.fctr,Q102089.fctr,Q100010.fctr,Q99982.fctr,Q113583.fctr,Q108342.fctr,Q104996.fctr,Q119650.fctr,Q100689.fctr,Q108617.fctr,Q115195.fctr,Q99716.fctr,Q101163.fctr,Q98059.fctr,Q114961.fctr,Hhold.fctr,Hhold.fctr:.clusterid.fctr,YOB.Age.fctr:YOB.Age.dff
##   max.nTuningRuns min.elapsedtime.everything min.elapsedtime.final
## 1              25                     42.917                 2.967
##   max.AUCpROC.fit max.Sens.fit max.Spec.fit max.AUCROCR.fit
## 1        0.612147    0.3725728    0.8517211       0.6915987
##   opt.prob.threshold.fit max.f.score.fit max.Accuracy.fit
## 1                   0.55       0.7089362        0.6128471
##   max.AccuracyLower.fit max.AccuracyUpper.fit max.Kappa.fit
## 1             0.6288914             0.6716276      0.160508
##   max.AUCpROC.OOB max.Sens.OOB max.Spec.OOB max.AUCROCR.OOB
## 1         0.56005    0.3457944    0.7743056       0.5756912
##   opt.prob.threshold.OOB max.f.score.OOB max.Accuracy.OOB
## 1                   0.45       0.7190083        0.5936255
##   max.AccuracyLower.OOB max.AccuracyUpper.OOB max.Kappa.OOB
## 1              0.549217             0.6369249    0.08697978
##   max.AccuracySD.fit max.KappaSD.fit
## 1        0.009498259      0.02294536
## [1] "myfit_mdl: exit: 55.584000 secs"
##                                        min.elapsedtime.everything
## Random###myrandom_classfr                                   0.272
## MFO###myMFO_classfr                                         0.501
## Max.cor.Y.rcv.1X1###glmnet                                  0.766
## Max.cor.Y##rcv#rpart                                        1.468
## All.X##rcv#glmnet                                          13.519
## All.X#conditionalX#rcv#glmnet                              13.941
## Low.cor.X##rcv#glmnet                                      14.590
## All.X#scale#rcv#glmnet                                     14.819
## All.X#zv#rcv#glmnet                                        14.938
## All.X#range#rcv#glmnet                                     15.454
## All.X#center#rcv#glmnet                                    15.479
## All.X#center.scale#rcv#glmnet                              16.964
## All.X#BoxCox#rcv#glmnet                                    17.604
## All.X#nzv#rcv#glmnet                                       17.988
## All.X#spatialSign#rcv#glmnet                               20.544
## All.X#ica#rcv#glmnet                                       22.835
## All.X#zv.pca#rcv#glmnet                                    42.121
## All.X#expoTrans.spatialSign#rcv#glmnet                     42.917
## All.X#YeoJohnson#rcv#glmnet                                45.222
## All.X#expoTrans#rcv#glmnet                                 51.149
##                  label step_major step_minor label_minor     bgn     end
## 4 fit.models_1_preProc          1          3     preProc  13.266 534.995
## 5     fit.models_1_end          1          4    teardown 534.995      NA
##   elapsed
## 4 521.729
## 5      NA
##          label step_major step_minor label_minor     bgn     end elapsed
## 1 fit.models_1          1          0           0   9.967 535.005 525.038
## 2   fit.models          1          1           1 535.006      NA      NA

```{r fit.models_2, cache=FALSE, fig.height=10, fig.width=15, eval=myevlChunk(glbChunks, glbOut$pfx)}

##              label step_major step_minor label_minor     bgn end elapsed
## 1 fit.models_2_bgn          1          0       setup 588.289  NA      NA
## Warning: max.AccuracyUpper.fit already exists in glb_models_df
## [1] "var:max.KappaSD.fit"
## Warning: Removed 3 rows containing missing values (geom_errorbar).
## quartz_off_screen 
##                 2
## Warning: Removed 3 rows containing missing values (geom_errorbar).

##                                        id max.Accuracy.OOB max.AUCROCR.OOB
## 20 All.X#expoTrans.spatialSign#rcv#glmnet        0.5936255       0.5756912
## 18           All.X#spatialSign#rcv#glmnet        0.5936255       0.5704991
## 11             All.X#expoTrans#rcv#glmnet        0.5916335       0.5697040
## 6                       All.X##rcv#glmnet        0.5896414       0.5814512
## 10            All.X#YeoJohnson#rcv#glmnet        0.5876494       0.5696554
## 19          All.X#conditionalX#rcv#glmnet        0.5856574       0.5688766
## 5                   Low.cor.X##rcv#glmnet        0.5856574       0.5688766
## 13                 All.X#scale#rcv#glmnet        0.5856574       0.5688766
## 7                     All.X#zv#rcv#glmnet        0.5856574       0.5688766
## 15                 All.X#range#rcv#glmnet        0.5856574       0.5688766
## 12                All.X#center#rcv#glmnet        0.5856574       0.5688766
## 14          All.X#center.scale#rcv#glmnet        0.5856574       0.5688766
## 9                 All.X#BoxCox#rcv#glmnet        0.5856574       0.5688766
## 8                    All.X#nzv#rcv#glmnet        0.5796813       0.5784657
## 16                All.X#zv.pca#rcv#glmnet        0.5796813       0.5588331
## 3              Max.cor.Y.rcv.1X1###glmnet        0.5756972       0.5719513
## 4                    Max.cor.Y##rcv#rpart        0.5737052       0.5452362
## 17                   All.X#ica#rcv#glmnet        0.5737052       0.5297573
## 2               Random###myrandom_classfr        0.5737052       0.5181075
## 1                     MFO###myMFO_classfr        0.5737052       0.5000000
##    max.AUCpROC.OOB min.elapsedtime.everything max.Accuracy.fit
## 20       0.5600500                     42.917        0.6128471
## 18       0.5554420                     20.544        0.6118257
## 11       0.5554420                     51.149        0.6109764
## 6        0.5541115                     13.519        0.6126764
## 10       0.5554420                     45.222        0.6109767
## 19       0.5554420                     13.941        0.6128487
## 5        0.5554420                     14.590        0.6128487
## 13       0.5554420                     14.819        0.6128487
## 7        0.5554420                     14.938        0.6128487
## 15       0.5554420                     15.454        0.6128487
## 12       0.5554420                     15.479        0.6128487
## 14       0.5554420                     16.964        0.6128487
## 9        0.5554420                     17.604        0.6128487
## 8        0.5436299                     17.988        0.6087590
## 16       0.5017848                     42.121        0.5959830
## 3        0.5468912                      0.766        0.6152274
## 4        0.5468912                      1.468        0.6136958
## 17       0.4820223                     22.835        0.5918896
## 2        0.4990752                      0.272        0.5789474
## 1        0.5000000                      0.501        0.5789474
##    opt.prob.threshold.fit opt.prob.threshold.OOB
## 20                   0.55                   0.45
## 18                   0.55                   0.45
## 11                   0.55                   0.45
## 6                    0.55                   0.50
## 10                   0.50                   0.45
## 19                   0.55                   0.50
## 5                    0.55                   0.50
## 13                   0.55                   0.50
## 7                    0.55                   0.50
## 15                   0.55                   0.50
## 12                   0.55                   0.50
## 14                   0.55                   0.50
## 9                    0.55                   0.50
## 8                    0.55                   0.50
## 16                   0.55                   0.55
## 3                    0.50                   0.55
## 4                    0.50                   0.40
## 17                   0.50                   0.40
## 2                    0.40                   0.40
## 1                    0.40                   0.40
## [1] "Metrics used for model selection:"
## ~-max.Accuracy.OOB - max.AUCROCR.OOB - max.AUCpROC.OOB + min.elapsedtime.everything - 
##     max.Accuracy.fit - opt.prob.threshold.OOB
## <environment: 0x7f8104f24478>
## [1] "Best model id: All.X#expoTrans.spatialSign#rcv#glmnet"
## glmnet 
## 
## 1957 samples
##  108 predictor
##    2 classes: 'D', 'R' 
## 
## Pre-processing: exponential transformation (260), spatial
##  sign transformation (260), centered (260), scaled (260) 
## Resampling: Cross-Validated (3 fold, repeated 3 times) 
## Summary of sample sizes: 1305, 1305, 1304, 1304, 1305, 1305, ... 
## Resampling results across tuning parameters:
## 
##   alpha  lambda      Accuracy   Kappa      
##   0.100  0.00720660  0.5631097  0.087759034
##   0.100  0.02000000  0.5792927  0.113087076
##   0.100  0.03345007  0.5901938  0.130012436
##   0.100  0.04000000  0.5934301  0.134657686
##   0.100  0.05969355  0.6014363  0.146386040
##   0.325  0.00720660  0.5758878  0.108347798
##   0.325  0.02000000  0.5961586  0.138436776
##   0.325  0.03345007  0.6109746  0.160956457
##   0.325  0.04000000  0.6128471  0.160507954
##   0.325  0.05969355  0.6084176  0.137167646
##   0.550  0.00720660  0.5850845  0.122792572
##   0.550  0.02000000  0.6097817  0.159653338
##   0.550  0.03345007  0.6090990  0.144015377
##   0.550  0.04000000  0.6038174  0.125422454
##   0.550  0.05969355  0.5920632  0.069661928
##   0.775  0.00720660  0.5936032  0.137960895
##   0.775  0.02000000  0.6109725  0.155406200
##   0.775  0.03345007  0.6017724  0.114649568
##   0.775  0.04000000  0.5964919  0.088067777
##   0.775  0.05969355  0.5784372  0.003098888
##   1.000  0.00720660  0.5949665  0.137113011
##   1.000  0.02000000  0.6077357  0.140151511
##   1.000  0.03345007  0.5922325  0.074264296
##   1.000  0.04000000  0.5821835  0.029798428
##   1.000  0.05969355  0.5789474  0.000000000
## 
## Accuracy was used to select the optimal model using  the largest value.
## The final values used for the model were alpha = 0.325 and lambda = 0.04.
## [1] "All.X#expoTrans.spatialSign#rcv#glmnet fit prediction diagnostics:"
## [1] "All.X#expoTrans.spatialSign#rcv#glmnet OOB prediction diagnostics:"
##                                 All.X.expoTrans.spatialSign.rcv.glmnet.imp
## Q115611.fctrYes                                                100.0000000
## Q113181.fctrNo                                                  95.3534018
## Hhold.fctrPKn                                                   72.3736413
## Q116881.fctrRight                                               63.5102201
## Q99480.fctrNo                                                   54.7705038
## Q98869.fctrNo                                                   53.8392977
## Q106997.fctrGr                                                  53.8293468
## Q101163.fctrDad                                                 52.9462718
## Q98197.fctrNo                                                   51.2895374
## Hhold.fctrPKy                                                   48.8973726
## Q113181.fctrYes                                                 37.0837563
## Q119650.fctrGiving                                              35.7211724
## Q124742.fctrNo                                                  33.9726792
## Q115611.fctrNo                                                  33.9313892
## Hhold.fctrMKy                                                   32.0285479
## Q106272.fctrNo                                                  28.7696462
## Q105655.fctrYes                                                 28.1499086
## Q114517.fctrNo                                                  26.3106333
## Q123621.fctrYes                                                 24.3374872
## Hhold.fctrPKy:.clusterid.fctr4                                  24.0708883
## Income.fctr.C                                                   23.6556411
## Q100562.fctrNo                                                  21.9532492
## Q109367.fctrNo                                                  21.4635778
## Q120472.fctrScience                                             19.0457801
## Income.fctr.Q                                                   18.7794022
## Q115899.fctrCs                                                  17.7016232
## Q118892.fctrNo                                                  16.9276058
## Q116881.fctrHappy                                               16.8262843
## Q110740.fctrPC                                                  16.2478906
## YOB.Age.fctr(35,40]:YOB.Age.dff                                 14.9297986
## Hhold.fctrSKy                                                   14.5868679
## Income.fctr^6                                                   14.3529560
## Q108855.fctrUmm...                                              14.1070607
## Hhold.fctrSKy:.clusterid.fctr3                                  13.9491938
## Q104996.fctrYes                                                 13.3267802
## Hhold.fctrN:.clusterid.fctr4                                    13.2538905
## Hhold.fctrMKy:.clusterid.fctr4                                  13.1648041
## Q99716.fctrYes                                                  12.6078177
## Q116953.fctrNo                                                  12.4240036
## Hhold.fctrSKn:.clusterid.fctr2                                  11.3977291
## Q109367.fctrYes                                                  8.8146390
## Q114386.fctrMysterious                                           7.6865479
## Q116601.fctrNo                                                   5.7800906
## Q120379.fctrYes                                                  5.4427713
## Q102089.fctrOwn                                                  4.0312831
## Q122769.fctrYes                                                  3.6547887
## Q117193.fctrStandard hours                                       3.5026709
## Q96024.fctrNo                                                    1.1407544
## Q108855.fctrYes!                                                 1.0727486
## Q106272.fctrYes                                                  0.9188083
## YOB.Age.fctr(25,30]:YOB.Age.dff                                  0.6262704
## Q122771.fctrPt                                                   0.4572496
## YOB.Age.fctr(65,90]:YOB.Age.dff                                  0.1756714
## Q99480.fctrYes                                                   0.1700106
## Q100689.fctrYes                                                  0.1638523
## .rnorm                                                           0.0000000
## Edn.fctr.L                                                       0.0000000
## Edn.fctr.Q                                                       0.0000000
## Edn.fctr.C                                                       0.0000000
## Edn.fctr^4                                                       0.0000000
## Edn.fctr^5                                                       0.0000000
## Edn.fctr^6                                                       0.0000000
## Edn.fctr^7                                                       0.0000000
## Gender.fctrF                                                     0.0000000
## Gender.fctrM                                                     0.0000000
## Hhold.fctrMKn                                                    0.0000000
## Hhold.fctrSKn                                                    0.0000000
## Income.fctr.L                                                    0.0000000
## Income.fctr^4                                                    0.0000000
## Income.fctr^5                                                    0.0000000
## Q100010.fctrNo                                                   0.0000000
## Q100010.fctrYes                                                  0.0000000
## Q100562.fctrYes                                                  0.0000000
## Q100680.fctrNo                                                   0.0000000
## Q100680.fctrYes                                                  0.0000000
## Q100689.fctrNo                                                   0.0000000
## Q101162.fctrOptimist                                             0.0000000
## Q101162.fctrPessimist                                            0.0000000
## Q101163.fctrMom                                                  0.0000000
## Q101596.fctrNo                                                   0.0000000
## Q101596.fctrYes                                                  0.0000000
## Q102089.fctrRent                                                 0.0000000
## Q102289.fctrNo                                                   0.0000000
## Q102289.fctrYes                                                  0.0000000
## Q102674.fctrNo                                                   0.0000000
## Q102674.fctrYes                                                  0.0000000
## Q102687.fctrNo                                                   0.0000000
## Q102687.fctrYes                                                  0.0000000
## Q102906.fctrNo                                                   0.0000000
## Q102906.fctrYes                                                  0.0000000
## Q103293.fctrNo                                                   0.0000000
## Q103293.fctrYes                                                  0.0000000
## Q104996.fctrNo                                                   0.0000000
## Q105655.fctrNo                                                   0.0000000
## Q105840.fctrNo                                                   0.0000000
## Q105840.fctrYes                                                  0.0000000
## Q106042.fctrNo                                                   0.0000000
## Q106042.fctrYes                                                  0.0000000
## Q106388.fctrNo                                                   0.0000000
## Q106388.fctrYes                                                  0.0000000
## Q106389.fctrNo                                                   0.0000000
## Q106389.fctrYes                                                  0.0000000
## Q106993.fctrNo                                                   0.0000000
## Q106993.fctrYes                                                  0.0000000
## Q106997.fctrYy                                                   0.0000000
## Q107491.fctrNo                                                   0.0000000
## Q107491.fctrYes                                                  0.0000000
## Q107869.fctrNo                                                   0.0000000
## Q107869.fctrYes                                                  0.0000000
## Q108342.fctrIn-person                                            0.0000000
## Q108342.fctrOnline                                               0.0000000
## Q108343.fctrNo                                                   0.0000000
## Q108343.fctrYes                                                  0.0000000
## Q108617.fctrNo                                                   0.0000000
## Q108617.fctrYes                                                  0.0000000
## Q108754.fctrNo                                                   0.0000000
## Q108754.fctrYes                                                  0.0000000
## Q108856.fctrSocialize                                            0.0000000
## Q108856.fctrSpace                                                0.0000000
## Q108950.fctrCautious                                             0.0000000
## Q108950.fctrRisk-friendly                                        0.0000000
## Q110740.fctrMac                                                  0.0000000
## Q111220.fctrNo                                                   0.0000000
## Q111220.fctrYes                                                  0.0000000
## Q111580.fctrDemanding                                            0.0000000
## Q111580.fctrSupportive                                           0.0000000
## Q111848.fctrNo                                                   0.0000000
## Q111848.fctrYes                                                  0.0000000
## Q112270.fctrNo                                                   0.0000000
## Q112270.fctrYes                                                  0.0000000
## Q112478.fctrNo                                                   0.0000000
## Q112478.fctrYes                                                  0.0000000
## Q112512.fctrNo                                                   0.0000000
## Q112512.fctrYes                                                  0.0000000
## Q113583.fctrTalk                                                 0.0000000
## Q113583.fctrTunes                                                0.0000000
## Q113584.fctrPeople                                               0.0000000
## Q113584.fctrTechnology                                           0.0000000
## Q113992.fctrNo                                                   0.0000000
## Q113992.fctrYes                                                  0.0000000
## Q114152.fctrNo                                                   0.0000000
## Q114152.fctrYes                                                  0.0000000
## Q114386.fctrTMI                                                  0.0000000
## Q114517.fctrYes                                                  0.0000000
## Q114748.fctrNo                                                   0.0000000
## Q114748.fctrYes                                                  0.0000000
## Q114961.fctrNo                                                   0.0000000
## Q114961.fctrYes                                                  0.0000000
## Q115195.fctrNo                                                   0.0000000
## Q115195.fctrYes                                                  0.0000000
## Q115390.fctrNo                                                   0.0000000
## Q115390.fctrYes                                                  0.0000000
## Q115602.fctrNo                                                   0.0000000
## Q115602.fctrYes                                                  0.0000000
## Q115610.fctrNo                                                   0.0000000
## Q115610.fctrYes                                                  0.0000000
## Q115777.fctrEnd                                                  0.0000000
## Q115777.fctrStart                                                0.0000000
## Q115899.fctrMe                                                   0.0000000
## Q116197.fctrA.M.                                                 0.0000000
## Q116197.fctrP.M.                                                 0.0000000
## Q116441.fctrNo                                                   0.0000000
## Q116441.fctrYes                                                  0.0000000
## Q116448.fctrNo                                                   0.0000000
## Q116448.fctrYes                                                  0.0000000
## Q116601.fctrYes                                                  0.0000000
## Q116797.fctrNo                                                   0.0000000
## Q116797.fctrYes                                                  0.0000000
## Q116953.fctrYes                                                  0.0000000
## Q117186.fctrCool headed                                          0.0000000
## Q117186.fctrHot headed                                           0.0000000
## Q117193.fctrOdd hours                                            0.0000000
## Q118117.fctrNo                                                   0.0000000
## Q118117.fctrYes                                                  0.0000000
## Q118232.fctrId                                                   0.0000000
## Q118232.fctrPr                                                   0.0000000
## Q118233.fctrNo                                                   0.0000000
## Q118233.fctrYes                                                  0.0000000
## Q118237.fctrNo                                                   0.0000000
## Q118237.fctrYes                                                  0.0000000
## Q118892.fctrYes                                                  0.0000000
## Q119334.fctrNo                                                   0.0000000
## Q119334.fctrYes                                                  0.0000000
## Q119650.fctrReceiving                                            0.0000000
## Q119851.fctrNo                                                   0.0000000
## Q119851.fctrYes                                                  0.0000000
## Q120012.fctrNo                                                   0.0000000
## Q120012.fctrYes                                                  0.0000000
## Q120014.fctrNo                                                   0.0000000
## Q120014.fctrYes                                                  0.0000000
## Q120194.fctrStudy first                                          0.0000000
## Q120194.fctrTry first                                            0.0000000
## Q120379.fctrNo                                                   0.0000000
## Q120472.fctrArt                                                  0.0000000
## Q120650.fctrNo                                                   0.0000000
## Q120650.fctrYes                                                  0.0000000
## Q120978.fctrNo                                                   0.0000000
## Q120978.fctrYes                                                  0.0000000
## Q121011.fctrNo                                                   0.0000000
## Q121011.fctrYes                                                  0.0000000
## Q121699.fctrNo                                                   0.0000000
## Q121699.fctrYes                                                  0.0000000
## Q121700.fctrNo                                                   0.0000000
## Q121700.fctrYes                                                  0.0000000
## Q122120.fctrNo                                                   0.0000000
## Q122120.fctrYes                                                  0.0000000
## Q122769.fctrNo                                                   0.0000000
## Q122770.fctrNo                                                   0.0000000
## Q122770.fctrYes                                                  0.0000000
## Q122771.fctrPc                                                   0.0000000
## Q123464.fctrNo                                                   0.0000000
## Q123464.fctrYes                                                  0.0000000
## Q123621.fctrNo                                                   0.0000000
## Q124122.fctrNo                                                   0.0000000
## Q124122.fctrYes                                                  0.0000000
## Q124742.fctrYes                                                  0.0000000
## Q96024.fctrYes                                                   0.0000000
## Q98059.fctrOnly-child                                            0.0000000
## Q98059.fctrYes                                                   0.0000000
## Q98078.fctrNo                                                    0.0000000
## Q98078.fctrYes                                                   0.0000000
## Q98197.fctrYes                                                   0.0000000
## Q98578.fctrNo                                                    0.0000000
## Q98578.fctrYes                                                   0.0000000
## Q98869.fctrYes                                                   0.0000000
## Q99581.fctrNo                                                    0.0000000
## Q99581.fctrYes                                                   0.0000000
## Q99716.fctrNo                                                    0.0000000
## Q99982.fctrCheck!                                                0.0000000
## Q99982.fctrNope                                                  0.0000000
## YOB.Age.fctr.L                                                   0.0000000
## YOB.Age.fctr.Q                                                   0.0000000
## YOB.Age.fctr.C                                                   0.0000000
## YOB.Age.fctr^4                                                   0.0000000
## YOB.Age.fctr^5                                                   0.0000000
## YOB.Age.fctr^6                                                   0.0000000
## YOB.Age.fctr^7                                                   0.0000000
## YOB.Age.fctr^8                                                   0.0000000
## Hhold.fctrN:.clusterid.fctr2                                     0.0000000
## Hhold.fctrMKn:.clusterid.fctr2                                   0.0000000
## Hhold.fctrMKy:.clusterid.fctr2                                   0.0000000
## Hhold.fctrPKn:.clusterid.fctr2                                   0.0000000
## Hhold.fctrPKy:.clusterid.fctr2                                   0.0000000
## Hhold.fctrSKy:.clusterid.fctr2                                   0.0000000
## Hhold.fctrN:.clusterid.fctr3                                     0.0000000
## Hhold.fctrMKn:.clusterid.fctr3                                   0.0000000
## Hhold.fctrMKy:.clusterid.fctr3                                   0.0000000
## Hhold.fctrPKn:.clusterid.fctr3                                   0.0000000
## Hhold.fctrPKy:.clusterid.fctr3                                   0.0000000
## Hhold.fctrSKn:.clusterid.fctr3                                   0.0000000
## Hhold.fctrMKn:.clusterid.fctr4                                   0.0000000
## Hhold.fctrPKn:.clusterid.fctr4                                   0.0000000
## Hhold.fctrSKn:.clusterid.fctr4                                   0.0000000
## Hhold.fctrSKy:.clusterid.fctr4                                   0.0000000
## YOB.Age.fctrNA:YOB.Age.dff                                       0.0000000
## YOB.Age.fctr(15,20]:YOB.Age.dff                                  0.0000000
## YOB.Age.fctr(20,25]:YOB.Age.dff                                  0.0000000
## YOB.Age.fctr(30,35]:YOB.Age.dff                                  0.0000000
## YOB.Age.fctr(40,50]:YOB.Age.dff                                  0.0000000
## YOB.Age.fctr(50,65]:YOB.Age.dff                                  0.0000000
##                                         imp
## Q115611.fctrYes                 100.0000000
## Q113181.fctrNo                   95.3534018
## Hhold.fctrPKn                    72.3736413
## Q116881.fctrRight                63.5102201
## Q99480.fctrNo                    54.7705038
## Q98869.fctrNo                    53.8392977
## Q106997.fctrGr                   53.8293468
## Q101163.fctrDad                  52.9462718
## Q98197.fctrNo                    51.2895374
## Hhold.fctrPKy                    48.8973726
## Q113181.fctrYes                  37.0837563
## Q119650.fctrGiving               35.7211724
## Q124742.fctrNo                   33.9726792
## Q115611.fctrNo                   33.9313892
## Hhold.fctrMKy                    32.0285479
## Q106272.fctrNo                   28.7696462
## Q105655.fctrYes                  28.1499086
## Q114517.fctrNo                   26.3106333
## Q123621.fctrYes                  24.3374872
## Hhold.fctrPKy:.clusterid.fctr4   24.0708883
## Income.fctr.C                    23.6556411
## Q100562.fctrNo                   21.9532492
## Q109367.fctrNo                   21.4635778
## Q120472.fctrScience              19.0457801
## Income.fctr.Q                    18.7794022
## Q115899.fctrCs                   17.7016232
## Q118892.fctrNo                   16.9276058
## Q116881.fctrHappy                16.8262843
## Q110740.fctrPC                   16.2478906
## YOB.Age.fctr(35,40]:YOB.Age.dff  14.9297986
## Hhold.fctrSKy                    14.5868679
## Income.fctr^6                    14.3529560
## Q108855.fctrUmm...               14.1070607
## Hhold.fctrSKy:.clusterid.fctr3   13.9491938
## Q104996.fctrYes                  13.3267802
## Hhold.fctrN:.clusterid.fctr4     13.2538905
## Hhold.fctrMKy:.clusterid.fctr4   13.1648041
## Q99716.fctrYes                   12.6078177
## Q116953.fctrNo                   12.4240036
## Hhold.fctrSKn:.clusterid.fctr2   11.3977291
## Q109367.fctrYes                   8.8146390
## Q114386.fctrMysterious            7.6865479
## Q116601.fctrNo                    5.7800906
## Q120379.fctrYes                   5.4427713
## Q102089.fctrOwn                   4.0312831
## Q122769.fctrYes                   3.6547887
## Q117193.fctrStandard hours        3.5026709
## Q96024.fctrNo                     1.1407544
## Q108855.fctrYes!                  1.0727486
## Q106272.fctrYes                   0.9188083
## YOB.Age.fctr(25,30]:YOB.Age.dff   0.6262704
## Q122771.fctrPt                    0.4572496
## YOB.Age.fctr(65,90]:YOB.Age.dff   0.1756714
## Q99480.fctrYes                    0.1700106
## Q100689.fctrYes                   0.1638523
## .rnorm                            0.0000000
## Edn.fctr.L                        0.0000000
## Edn.fctr.Q                        0.0000000
## Edn.fctr.C                        0.0000000
## Edn.fctr^4                        0.0000000
## Edn.fctr^5                        0.0000000
## Edn.fctr^6                        0.0000000
## Edn.fctr^7                        0.0000000
## Gender.fctrF                      0.0000000
## Gender.fctrM                      0.0000000
## Hhold.fctrMKn                     0.0000000
## Hhold.fctrSKn                     0.0000000
## Income.fctr.L                     0.0000000
## Income.fctr^4                     0.0000000
## Income.fctr^5                     0.0000000
## Q100010.fctrNo                    0.0000000
## Q100010.fctrYes                   0.0000000
## Q100562.fctrYes                   0.0000000
## Q100680.fctrNo                    0.0000000
## Q100680.fctrYes                   0.0000000
## Q100689.fctrNo                    0.0000000
## Q101162.fctrOptimist              0.0000000
## Q101162.fctrPessimist             0.0000000
## Q101163.fctrMom                   0.0000000
## Q101596.fctrNo                    0.0000000
## Q101596.fctrYes                   0.0000000
## Q102089.fctrRent                  0.0000000
## Q102289.fctrNo                    0.0000000
## Q102289.fctrYes                   0.0000000
## Q102674.fctrNo                    0.0000000
## Q102674.fctrYes                   0.0000000
## Q102687.fctrNo                    0.0000000
## Q102687.fctrYes                   0.0000000
## Q102906.fctrNo                    0.0000000
## Q102906.fctrYes                   0.0000000
## Q103293.fctrNo                    0.0000000
## Q103293.fctrYes                   0.0000000
## Q104996.fctrNo                    0.0000000
## Q105655.fctrNo                    0.0000000
## Q105840.fctrNo                    0.0000000
## Q105840.fctrYes                   0.0000000
## Q106042.fctrNo                    0.0000000
## Q106042.fctrYes                   0.0000000
## Q106388.fctrNo                    0.0000000
## Q106388.fctrYes                   0.0000000
## Q106389.fctrNo                    0.0000000
## Q106389.fctrYes                   0.0000000
## Q106993.fctrNo                    0.0000000
## Q106993.fctrYes                   0.0000000
## Q106997.fctrYy                    0.0000000
## Q107491.fctrNo                    0.0000000
## Q107491.fctrYes                   0.0000000
## Q107869.fctrNo                    0.0000000
## Q107869.fctrYes                   0.0000000
## Q108342.fctrIn-person             0.0000000
## Q108342.fctrOnline                0.0000000
## Q108343.fctrNo                    0.0000000
## Q108343.fctrYes                   0.0000000
## Q108617.fctrNo                    0.0000000
## Q108617.fctrYes                   0.0000000
## Q108754.fctrNo                    0.0000000
## Q108754.fctrYes                   0.0000000
## Q108856.fctrSocialize             0.0000000
## Q108856.fctrSpace                 0.0000000
## Q108950.fctrCautious              0.0000000
## Q108950.fctrRisk-friendly         0.0000000
## Q110740.fctrMac                   0.0000000
## Q111220.fctrNo                    0.0000000
## Q111220.fctrYes                   0.0000000
## Q111580.fctrDemanding             0.0000000
## Q111580.fctrSupportive            0.0000000
## Q111848.fctrNo                    0.0000000
## Q111848.fctrYes                   0.0000000
## Q112270.fctrNo                    0.0000000
## Q112270.fctrYes                   0.0000000
## Q112478.fctrNo                    0.0000000
## Q112478.fctrYes                   0.0000000
## Q112512.fctrNo                    0.0000000
## Q112512.fctrYes                   0.0000000
## Q113583.fctrTalk                  0.0000000
## Q113583.fctrTunes                 0.0000000
## Q113584.fctrPeople                0.0000000
## Q113584.fctrTechnology            0.0000000
## Q113992.fctrNo                    0.0000000
## Q113992.fctrYes                   0.0000000
## Q114152.fctrNo                    0.0000000
## Q114152.fctrYes                   0.0000000
## Q114386.fctrTMI                   0.0000000
## Q114517.fctrYes                   0.0000000
## Q114748.fctrNo                    0.0000000
## Q114748.fctrYes                   0.0000000
## Q114961.fctrNo                    0.0000000
## Q114961.fctrYes                   0.0000000
## Q115195.fctrNo                    0.0000000
## Q115195.fctrYes                   0.0000000
## Q115390.fctrNo                    0.0000000
## Q115390.fctrYes                   0.0000000
## Q115602.fctrNo                    0.0000000
## Q115602.fctrYes                   0.0000000
## Q115610.fctrNo                    0.0000000
## Q115610.fctrYes                   0.0000000
## Q115777.fctrEnd                   0.0000000
## Q115777.fctrStart                 0.0000000
## Q115899.fctrMe                    0.0000000
## Q116197.fctrA.M.                  0.0000000
## Q116197.fctrP.M.                  0.0000000
## Q116441.fctrNo                    0.0000000
## Q116441.fctrYes                   0.0000000
## Q116448.fctrNo                    0.0000000
## Q116448.fctrYes                   0.0000000
## Q116601.fctrYes                   0.0000000
## Q116797.fctrNo                    0.0000000
## Q116797.fctrYes                   0.0000000
## Q116953.fctrYes                   0.0000000
## Q117186.fctrCool headed           0.0000000
## Q117186.fctrHot headed            0.0000000
## Q117193.fctrOdd hours             0.0000000
## Q118117.fctrNo                    0.0000000
## Q118117.fctrYes                   0.0000000
## Q118232.fctrId                    0.0000000
## Q118232.fctrPr                    0.0000000
## Q118233.fctrNo                    0.0000000
## Q118233.fctrYes                   0.0000000
## Q118237.fctrNo                    0.0000000
## Q118237.fctrYes                   0.0000000
## Q118892.fctrYes                   0.0000000
## Q119334.fctrNo                    0.0000000
## Q119334.fctrYes                   0.0000000
## Q119650.fctrReceiving             0.0000000
## Q119851.fctrNo                    0.0000000
## Q119851.fctrYes                   0.0000000
## Q120012.fctrNo                    0.0000000
## Q120012.fctrYes                   0.0000000
## Q120014.fctrNo                    0.0000000
## Q120014.fctrYes                   0.0000000
## Q120194.fctrStudy first           0.0000000
## Q120194.fctrTry first             0.0000000
## Q120379.fctrNo                    0.0000000
## Q120472.fctrArt                   0.0000000
## Q120650.fctrNo                    0.0000000
## Q120650.fctrYes                   0.0000000
## Q120978.fctrNo                    0.0000000
## Q120978.fctrYes                   0.0000000
## Q121011.fctrNo                    0.0000000
## Q121011.fctrYes                   0.0000000
## Q121699.fctrNo                    0.0000000
## Q121699.fctrYes                   0.0000000
## Q121700.fctrNo                    0.0000000
## Q121700.fctrYes                   0.0000000
## Q122120.fctrNo                    0.0000000
## Q122120.fctrYes                   0.0000000
## Q122769.fctrNo                    0.0000000
## Q122770.fctrNo                    0.0000000
## Q122770.fctrYes                   0.0000000
## Q122771.fctrPc                    0.0000000
## Q123464.fctrNo                    0.0000000
## Q123464.fctrYes                   0.0000000
## Q123621.fctrNo                    0.0000000
## Q124122.fctrNo                    0.0000000
## Q124122.fctrYes                   0.0000000
## Q124742.fctrYes                   0.0000000
## Q96024.fctrYes                    0.0000000
## Q98059.fctrOnly-child             0.0000000
## Q98059.fctrYes                    0.0000000
## Q98078.fctrNo                     0.0000000
## Q98078.fctrYes                    0.0000000
## Q98197.fctrYes                    0.0000000
## Q98578.fctrNo                     0.0000000
## Q98578.fctrYes                    0.0000000
## Q98869.fctrYes                    0.0000000
## Q99581.fctrNo                     0.0000000
## Q99581.fctrYes                    0.0000000
## Q99716.fctrNo                     0.0000000
## Q99982.fctrCheck!                 0.0000000
## Q99982.fctrNope                   0.0000000
## YOB.Age.fctr.L                    0.0000000
## YOB.Age.fctr.Q                    0.0000000
## YOB.Age.fctr.C                    0.0000000
## YOB.Age.fctr^4                    0.0000000
## YOB.Age.fctr^5                    0.0000000
## YOB.Age.fctr^6                    0.0000000
## YOB.Age.fctr^7                    0.0000000
## YOB.Age.fctr^8                    0.0000000
## Hhold.fctrN:.clusterid.fctr2      0.0000000
## Hhold.fctrMKn:.clusterid.fctr2    0.0000000
## Hhold.fctrMKy:.clusterid.fctr2    0.0000000
## Hhold.fctrPKn:.clusterid.fctr2    0.0000000
## Hhold.fctrPKy:.clusterid.fctr2    0.0000000
## Hhold.fctrSKy:.clusterid.fctr2    0.0000000
## Hhold.fctrN:.clusterid.fctr3      0.0000000
## Hhold.fctrMKn:.clusterid.fctr3    0.0000000
## Hhold.fctrMKy:.clusterid.fctr3    0.0000000
## Hhold.fctrPKn:.clusterid.fctr3    0.0000000
## Hhold.fctrPKy:.clusterid.fctr3    0.0000000
## Hhold.fctrSKn:.clusterid.fctr3    0.0000000
## Hhold.fctrMKn:.clusterid.fctr4    0.0000000
## Hhold.fctrPKn:.clusterid.fctr4    0.0000000
## Hhold.fctrSKn:.clusterid.fctr4    0.0000000
## Hhold.fctrSKy:.clusterid.fctr4    0.0000000
## YOB.Age.fctrNA:YOB.Age.dff        0.0000000
## YOB.Age.fctr(15,20]:YOB.Age.dff   0.0000000
## YOB.Age.fctr(20,25]:YOB.Age.dff   0.0000000
## YOB.Age.fctr(30,35]:YOB.Age.dff   0.0000000
## YOB.Age.fctr(40,50]:YOB.Age.dff   0.0000000
## YOB.Age.fctr(50,65]:YOB.Age.dff   0.0000000
## Warning in glb_analytics_diag_plots(obs_df = glbObsOOB, mdl_id =
## glbMdlSelId, : Limiting important feature scatter plots to 5 out of 108

## Loading required package: lazyeval

## [1] "Min/Max Boundaries: "
## [1] "Inaccurate: "
##   USER_ID Party.fctr
## 1     470          R
## 2    1836          R
## 3    3312          R
## 4    5379          R
## 5     183          R
## 6    4146          R
##   Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet.prob
## 1                                              0.3004303
## 2                                              0.3365100
## 3                                              0.3418227
## 4                                              0.3506066
## 5                                              0.3773732
## 6                                              0.3821215
##   Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet
## 1                                                 D
## 2                                                 D
## 3                                                 D
## 4                                                 D
## 5                                                 D
## 6                                                 D
##   Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet.err
## 1                                                  TRUE
## 2                                                  TRUE
## 3                                                  TRUE
## 4                                                  TRUE
## 5                                                  TRUE
## 6                                                  TRUE
##   Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet.err.abs
## 1                                                 0.6995697
## 2                                                 0.6634900
## 3                                                 0.6581773
## 4                                                 0.6493934
## 5                                                 0.6226268
## 6                                                 0.6178785
##   Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet.is.acc
## 1                                                    FALSE
## 2                                                    FALSE
## 3                                                    FALSE
## 4                                                    FALSE
## 5                                                    FALSE
## 6                                                    FALSE
##   Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet.accurate
## 1                                                      FALSE
## 2                                                      FALSE
## 3                                                      FALSE
## 4                                                      FALSE
## 5                                                      FALSE
## 6                                                      FALSE
##   Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet.error
## 1                                             -0.14956970
## 2                                             -0.11349004
## 3                                             -0.10817725
## 4                                             -0.09939345
## 5                                             -0.07262680
## 6                                             -0.06787850
##     USER_ID Party.fctr
## 23     4017          R
## 39      526          D
## 46     1979          D
## 49     1038          D
## 127    3644          D
## 160    6107          D
##     Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet.prob
## 23                                               0.4324538
## 39                                               0.4650899
## 46                                               0.4760947
## 49                                               0.4806819
## 127                                              0.5942744
## 160                                              0.6392700
##     Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet
## 23                                                  D
## 39                                                  R
## 46                                                  R
## 49                                                  R
## 127                                                 R
## 160                                                 R
##     Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet.err
## 23                                                   TRUE
## 39                                                   TRUE
## 46                                                   TRUE
## 49                                                   TRUE
## 127                                                  TRUE
## 160                                                  TRUE
##     Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet.err.abs
## 23                                                  0.5675462
## 39                                                  0.4650899
## 46                                                  0.4760947
## 49                                                  0.4806819
## 127                                                 0.5942744
## 160                                                 0.6392700
##     Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet.is.acc
## 23                                                     FALSE
## 39                                                     FALSE
## 46                                                     FALSE
## 49                                                     FALSE
## 127                                                    FALSE
## 160                                                    FALSE
##     Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet.accurate
## 23                                                       FALSE
## 39                                                       FALSE
## 46                                                       FALSE
## 49                                                       FALSE
## 127                                                      FALSE
## 160                                                      FALSE
##     Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet.error
## 23                                              -0.01754624
## 39                                               0.01508989
## 46                                               0.02609467
## 49                                               0.03068186
## 127                                              0.14427439
## 160                                              0.18926996
##     USER_ID Party.fctr
## 199    4956          D
## 200    1207          D
## 201    2798          D
## 202    3474          D
## 203    3221          D
## 204    1311          D
##     Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet.prob
## 199                                              0.7461831
## 200                                              0.7465315
## 201                                              0.7549233
## 202                                              0.7552433
## 203                                              0.7590532
## 204                                              0.7794015
##     Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet
## 199                                                 R
## 200                                                 R
## 201                                                 R
## 202                                                 R
## 203                                                 R
## 204                                                 R
##     Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet.err
## 199                                                  TRUE
## 200                                                  TRUE
## 201                                                  TRUE
## 202                                                  TRUE
## 203                                                  TRUE
## 204                                                  TRUE
##     Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet.err.abs
## 199                                                 0.7461831
## 200                                                 0.7465315
## 201                                                 0.7549233
## 202                                                 0.7552433
## 203                                                 0.7590532
## 204                                                 0.7794015
##     Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet.is.acc
## 199                                                    FALSE
## 200                                                    FALSE
## 201                                                    FALSE
## 202                                                    FALSE
## 203                                                    FALSE
## 204                                                    FALSE
##     Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet.accurate
## 199                                                      FALSE
## 200                                                      FALSE
## 201                                                      FALSE
## 202                                                      FALSE
## 203                                                      FALSE
## 204                                                      FALSE
##     Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet.error
## 199                                               0.2961831
## 200                                               0.2965315
## 201                                               0.3049233
## 202                                               0.3052433
## 203                                               0.3090532
## 204                                               0.3294015

##     Hhold.fctr .n.OOB .n.Fit .n.Tst .freqRatio.Fit .freqRatio.OOB
## PKn        PKn     13     50     15    0.025549310     0.02589641
## PKy        PKy      6     14      6    0.007153807     0.01195219
## SKy        SKy     23     61     27    0.031170158     0.04581673
## SKn        SKn    201    810    252    0.413898825     0.40039841
## MKy        MKy    156    680    195    0.347470618     0.31075697
## MKn        MKn     75    226     94    0.115482882     0.14940239
## N            N     28    116     33    0.059274400     0.05577689
##     .freqRatio.Tst err.abs.fit.sum err.abs.fit.mean .n.fit err.abs.OOB.sum
## PKn    0.024115756       22.893872        0.4578774     50        7.134215
## PKy    0.009646302        6.299374        0.4499553     14        2.971012
## SKy    0.043408360       28.827288        0.4725785     61       11.348368
## SKn    0.405144695      373.399097        0.4609865    810       97.262331
## MKy    0.313504823      300.522687        0.4419451    680       73.031659
## MKn    0.151125402      103.615614        0.4584762    226       34.933708
## N      0.053054662       53.063882        0.4574473    116       12.946810
##     err.abs.OOB.mean
## PKn        0.5487857
## PKy        0.4951687
## SKy        0.4934073
## SKn        0.4838922
## MKy        0.4681517
## MKn        0.4657828
## N          0.4623861
##           .n.OOB           .n.Fit           .n.Tst   .freqRatio.Fit 
##       502.000000      1957.000000       622.000000         1.000000 
##   .freqRatio.OOB   .freqRatio.Tst  err.abs.fit.sum err.abs.fit.mean 
##         1.000000         1.000000       888.621814         3.199266 
##           .n.fit  err.abs.OOB.sum err.abs.OOB.mean 
##      1957.000000       239.628103         3.417574
##              label step_major step_minor label_minor     bgn end elapsed
## 1 fit.models_2_bgn          1          0    teardown 597.149  NA      NA
##        label step_major step_minor label_minor     bgn    end elapsed
## 2 fit.models          1          1           1 535.006 597.16  62.154
## 3 fit.models          1          2           2 597.161     NA      NA
# if (sum(is.na(glbObsAll$D.P.http)) > 0)
#         stop("fit.models_3: Why is this happening ?")

#stop(here"); glb2Sav()
sync_glb_obs_df <- function() {
    # Merge or cbind ?
    for (col in setdiff(names(glbObsFit), names(glbObsTrn)))
        glbObsTrn[glbObsTrn$.lcn == "Fit", col] <<- glbObsFit[, col]
    for (col in setdiff(names(glbObsFit), names(glbObsAll)))
        glbObsAll[glbObsAll$.lcn == "Fit", col] <<- glbObsFit[, col]
    if (all(is.na(glbObsNew[, glb_rsp_var])))
        for (col in setdiff(names(glbObsOOB), names(glbObsTrn)))
            glbObsTrn[glbObsTrn$.lcn == "OOB", col] <<- glbObsOOB[, col]
    for (col in setdiff(names(glbObsOOB), names(glbObsAll)))
        glbObsAll[glbObsAll$.lcn == "OOB", col] <<- glbObsOOB[, col]
}
sync_glb_obs_df()
    
print(setdiff(names(glbObsNew), names(glbObsAll)))
## character(0)
replay.petrisim(pn = glb_analytics_pn, 
    replay.trans = (glb_analytics_avl_objs <- c(glb_analytics_avl_objs, 
        "model.selected")), flip_coord = TRUE)
## time trans    "bgn " "fit.data.training.all " "predict.data.new " "end " 
## 0.0000   multiple enabled transitions:  data.training.all data.new model.selected    firing:  model.selected 
## 1.0000    3   2 1 0 0

glb_chunks_df <- myadd_chunk(glb_chunks_df, "fit.data.training", major.inc = TRUE)
##               label step_major step_minor label_minor     bgn     end
## 3        fit.models          1          2           2 597.161 600.612
## 4 fit.data.training          2          0           0 600.612      NA
##   elapsed
## 3   3.451
## 4      NA

Step 2.0: fit data training

#load(paste0(glb_inp_pfx, "dsk.RData"))

if (!is.null(glbMdlFinId) && (glbMdlFinId %in% names(glb_models_lst))) {
    warning("Final model same as user selected model")
    glb_fin_mdl <- glb_models_lst[[glbMdlFinId]]
} else 
# if (nrow(glbObsFit) + length(glbObsFitOutliers) == nrow(glbObsTrn))
if (!all(is.na(glbObsNew[, glb_rsp_var]))) {    
    warning("Final model same as glbMdlSelId")
    glbMdlFinId <- paste0("Final.", glbMdlSelId)
    glb_fin_mdl <- glb_sel_mdl
    glb_models_lst[[glbMdlFinId]] <- glb_fin_mdl
    mdlDf <- glb_models_df[glb_models_df$id == glbMdlSelId, ]
    mdlDf$id <- glbMdlFinId
    glb_models_df <- rbind(glb_models_df, mdlDf)
} else {    
    if (myparseMdlId(glbMdlSelId)$family == "RFE.X") {
        indepVar <- mygetIndepVar(glb_feats_df)
        trnRFEResults <- 
            myrun_rfe(glbObsTrn, indepVar, glbRFESizes[["Final"]])
        if (!isTRUE(all.equal(sort(predictors(trnRFEResults)),
                              sort(predictors(glbRFEResults))))) {
            print("Diffs predictors(trnRFEResults) vs. predictors(glbRFEResults):")
            print(setdiff(predictors(trnRFEResults), predictors(glbRFEResults)))
            print("Diffs predictors(glbRFEResults) vs. predictors(trnRFEResults):")
            print(setdiff(predictors(glbRFEResults), predictors(trnRFEResults)))
        }
    }

    if (grepl("Ensemble", glbMdlSelId)) {
        # Find which models are relevant
        mdlimp_df <- subset(myget_feats_importance(glb_sel_mdl), imp > 5)
        mdlIndepVar <- row.names(mdlimp_df)
        if (glb_is_classification)
            mdlIdVcr <- glbMdlEnsemble[sapply(glbMdlEnsemble, function(thsMdlId)
                            mygetPredictIds(glb_rsp_var, thsMdlId)$prob  %in% mdlIndepVar)] else
            mdlIdVcr <- glbMdlEnsemble[sapply(glbMdlEnsemble, function(thsMdlId)
                            mygetPredictIds(glb_rsp_var, thsMdlId)$value %in% mdlIndepVar)]
        # Fit selected models on glbObsTrn
        for (mdl_id in mdlIdVcr) {
            mdl_id_components <- myparseMdlId(mdl_id)
            mdlIdPfx <- mdl_id_components$family
            # if (grepl("RFE\\.X\\.", mdlIdPfx)) 
            #     mdlIndepVars <- myadjustInteractionFeats(glb_feats_df, myextract_actual_feats(
            #         predictors(trnRFEResults))) else
                # mdlIndepVars <- trim(unlist(
                #     strsplit(glb_models_df[glb_models_df$id == mdl_id, "feats"], "[,]")))
            thsIndepVar <- unlist(
                    strsplit(glb_models_df[glb_models_df$id == mdl_id, "feats"], "[,]"))
            thsSpc <- myinit_mdl_specs_lst(mdl_specs_lst = list(
                        id.prefix = paste0("Final.", mdlIdPfx), 
                        type = glb_model_type, tune.df = glbMdlTuneParams,
                        trainControl.method = mdl_id_components$resample,
                        trainControl.number = glb_rcv_n_folds,
                        trainControl.repeats = glb_rcv_n_repeats,
                        trainControl.classProbs = glb_is_classification,
                        trainControl.summaryFunction = glbMdlMetricSummaryFn,
                        trainControl.allowParallel = glbMdlAllowParallel,
                        train.metric = glbMdlMetricSummary, 
                        train.maximize = glbMdlMetricMaximize,    
                        train.method = mdl_id_components$alg,
                        train.preProcess = mdl_id_components$preProcess))
            ret_lst <- myfit_mdl(mdl_specs_lst = thsSpc,
                    indepVar = thsIndepVar,
                    rsp_var = glb_rsp_var, 
                    fit_df = glbObsTrn, OOB_df = NULL)
            
            glbObsTrn <- glb_get_predictions(df = glbObsTrn,
                                                mdl_id = thsSpc$id, 
                                                rsp_var = glb_rsp_var,
                                                prob_threshold_def = 
                    subset(glb_models_df, id == mdl_id)$opt.prob.threshold.OOB)
            glbObsNew <- glb_get_predictions(df = glbObsNew,
                                                mdl_id = thsSpc$id, 
                                                rsp_var = glb_rsp_var,
                                                prob_threshold_def = 
                    subset(glb_models_df, id == mdl_id)$opt.prob.threshold.OOB)
        }    
    }
    
    # "Final" model
    if ((model_method <- glb_sel_mdl$method) == "custom")
        # get actual method from the mdl_id
        model_method <- tail(unlist(strsplit(glbMdlSelId, "[.]")), 1)
        
    if (grepl("Ensemble", glbMdlSelId)) {
        # Find which models are relevant
        mdlimp_df <- subset(myget_feats_importance(glb_sel_mdl), imp > 5)
        mdlIndepVar <- row.names(mdlimp_df)        
        if (glb_is_classification)
            mdlIdVcr <- glbMdlEnsemble[sapply(glbMdlEnsemble, function(thsMdlId)
                            mygetPredictIds(glb_rsp_var, thsMdlId)$prob  %in% mdlIndepVar)] else
            mdlIdVcr <- glbMdlEnsemble[sapply(glbMdlEnsemble, function(thsMdlId)
                            mygetPredictIds(glb_rsp_var, thsMdlId)$value %in% mdlIndepVar)]
        mdlIdVcr <- paste("Final", mdlIdVcr, sep = ".")
        mdlIndepVar <- gsub(glb_rsp_var, paste0(glb_rsp_var, ".Final"), mdlIndepVar, fixed = TRUE)
        
        # if (glb_is_classification && glb_is_binomial)
        #     indepVar <- gsub("(.*)\\.(.*)\\.prob", "\\1\\.Train\\.\\2\\.prob",
        #                             row.names(mdlimp_df)) else
        #     indepVar <- gsub("(.*)\\.(.*)", "\\1\\.Train\\.\\2",
        #                             row.names(mdlimp_df))
    } else 
    if (grepl("RFE.X", glbMdlSelId, fixed = TRUE)) {
        # indepVar <- myextract_actual_feats(predictors(trnRFEResults))
        mdlIndepVar <- myextract_actual_feats(predictors(glbRFEResults))        
    } else mdlIndepVar <- 
                trim(unlist(strsplit(glb_models_df[glb_models_df$id ==
                                                   glbMdlSelId
                                                   , "feats"], "[,]")))
        
    # if (!is.null(glbMdlPreprocMethods) &&
    #     ((match_pos <- regexpr(gsub(".", "\\.", 
    #                                 paste(glbMdlPreprocMethods, collapse = "|"),
    #                                fixed = TRUE), glbMdlSelId)) != -1))
    #     ths_preProcess <- str_sub(glbMdlSelId, match_pos, 
    #                             match_pos + attr(match_pos, "match.length") - 1) else
    #     ths_preProcess <- NULL   
    
    # mdl_id_pfx <- ifelse(grepl("Ensemble", glbMdlSelId),
    #                                "Final.Ensemble", "Final")
    thsMdlId <- paste0("Final.", glbMdlSelId)
    thsMdlIdComponents <- myparseMdlId(thsMdlId)
    # mdl_id_pfx <- paste("Final", myparseMdlId(glbMdlSelId)$family, sep = ".")
    mdl_id_pfx <- thsMdlIdComponents$family
    
    trnobs_df <- glbObsTrn 
    if (!is.null(glbObsTrnOutliers[[mdl_id_pfx]])) {
        trnobs_df <- glbObsTrn[!(glbObsTrn[, glbFeatsId] %in% glbObsTrnOutliers[[mdl_id_pfx]]), ]
        print(sprintf("Outliers removed: %d", nrow(glbObsTrn) - nrow(trnobs_df)))
        print(setdiff(glbObsTrn[, glbFeatsId], trnobs_df[, glbFeatsId]))
    }    
        
    # Force fitting of Final.glm to identify outliers
    # method_vctr <- unique(c(myparseMdlId(glbMdlSelId)$alg, glbMdlFamilies[["Final"]]))

    thsSpc <- myinit_mdl_specs_lst(mdl_specs_lst = list(
        id.prefix = mdl_id_pfx, 
        type = glb_model_type, tune.df = glbMdlTuneParams,
        trainControl.method = thsMdlIdComponents$resample,
        trainControl.number = glb_rcv_n_folds,
        trainControl.repeats = glb_rcv_n_repeats,
        trainControl.classProbs = glb_is_classification,
        trainControl.summaryFunction = glbMdlMetricSummaryFn,
        trainControl.allowParallel = glbMdlAllowParallel,
        train.metric = glbMdlMetricSummary, 
        train.maximize = glbMdlMetricMaximize,    
        train.method = thsMdlIdComponents$alg,
        train.preProcess = thsMdlIdComponents$preProcess))

    glbMdlFinId <- thsSpc$id
    if (!(grepl("Ensemble", glbMdlSelId)))
        ret_lst <- myfit_mdl(mdl_specs_lst = thsSpc,
                             indepVar = mdlIndepVar,
                             rsp_var = glb_rsp_var, 
                             fit_df = glbObsTrn, OOB_df = NULL) else {
                                 
        # Final model same as selected model except for the model features
        tmp_models_df <- glb_models_df[glb_models_df$id == glbMdlSelId, ]
        tmp_models_df$id <- paste0("Final.", tmp_models_df$id)
        row.names(tmp_models_df) <- tmp_models_df$id
        tmp_models_df$feats <- gsub(glb_rsp_var, paste0(glb_rsp_var, ".Final"),
                                    tmp_models_df$feats, fixed = TRUE)
        glb_models_df <- rbind(glb_models_df, tmp_models_df)
        
        tmp_fin_mdl <- glb_sel_mdl
        # tmp_fin_mdl$coefnames <- gsub(glb_rsp_var, paste0(glb_rsp_var, ".Final"),
        #                               tmp_fin_mdl$coefnames, fixed = TRUE)
        # dimnames(tmp_fin_mdl$finalModel$beta)[[1]] <- 
        #     gsub(glb_rsp_var, paste0(glb_rsp_var, ".Final"),
        #         dimnames(tmp_fin_mdl$finalModel$beta)[[1]], fixed = TRUE)
        # tmp_fin_mdl$finalModel$xNames <- 
        #     gsub(glb_rsp_var, paste0(glb_rsp_var, ".Final"),
        #         tmp_fin_mdl$finalModel$xNames, fixed = TRUE)
        # 
        # thsAts <- attributes(tmp_fin_mdl$terms)
        # # thsAts$variables <- class == "call" & objects / symbols are stored as a formula
        # thsAts$term.labels <- 
        #     gsub(glb_rsp_var, paste0(glb_rsp_var, ".Final"),
        #         thsAts$term.labels, fixed = TRUE)
        # attributes(tmp_fin_mdl$terms) <- thsAts
        # 
        glb_models_lst[[glbMdlFinId]] <- tmp_fin_mdl
    }
    
    glb_fin_mdl <- glb_models_lst[[glbMdlFinId]] 
}
## [1] "myfit_mdl: enter: 0.000000 secs"
## [1] "myfit_mdl: fitting model: Final.All.X#expoTrans.spatialSign#rcv#glmnet"
## [1] "    indepVar: Q115611.fctr,Q113181.fctr,Q98197.fctr,Q116881.fctr,Q108855.fctr,Q106272.fctr,Q122771.fctr,Q123621.fctr,Q106388.fctr,Q110740.fctr,Q122769.fctr,Q120472.fctr,Q101596.fctr,Q119334.fctr,Q114152.fctr,Q98869.fctr,Q115899.fctr,Q116797.fctr,Q118232.fctr,Gender.fctr,Q105655.fctr,Q99480.fctr,Q123464.fctr,Q120650.fctr,Q122120.fctr,Q107869.fctr,Q120014.fctr,Q102289.fctr,Income.fctr,Q122770.fctr,Q111580.fctr,Q116601.fctr,Q117186.fctr,Q106993.fctr,Q112270.fctr,Q101162.fctr,Q108856.fctr,Q117193.fctr,Q116441.fctr,Q119851.fctr,Q111848.fctr,Q98578.fctr,Q118892.fctr,Q114386.fctr,Q120978.fctr,Q112512.fctr,Q102674.fctr,Q96024.fctr,Q108950.fctr,Q115610.fctr,YOB.Age.fctr,Q112478.fctr,Q116197.fctr,Q124742.fctr,Q106389.fctr,Edn.fctr,Q118117.fctr,Q100562.fctr,Q107491.fctr,Q116448.fctr,Q108754.fctr,Q116953.fctr,Q115602.fctr,Q118233.fctr,Q120012.fctr,Q118237.fctr,Q99581.fctr,.rnorm,Q120194.fctr,Q115777.fctr,Q106997.fctr,Q100680.fctr,Q113584.fctr,Q108343.fctr,Q121700.fctr,Q105840.fctr,Q120379.fctr,Q103293.fctr,Q124122.fctr,Q109367.fctr,Q113992.fctr,Q121699.fctr,Q121011.fctr,Q114748.fctr,Q106042.fctr,Q111220.fctr,Q114517.fctr,Q102687.fctr,Q102906.fctr,Q98078.fctr,Q115390.fctr,Q102089.fctr,Q100010.fctr,Q99982.fctr,Q113583.fctr,Q108342.fctr,Q104996.fctr,Q119650.fctr,Q100689.fctr,Q108617.fctr,Q115195.fctr,Q99716.fctr,Q101163.fctr,Q98059.fctr,Q114961.fctr,Hhold.fctr,Hhold.fctr:.clusterid.fctr,YOB.Age.fctr:YOB.Age.dff"
## [1] "myfit_mdl: setup complete: 0.691000 secs"
## Aggregating results
## Selecting tuning parameters
## Fitting alpha = 0.55, lambda = 0.0301 on full training set
## Warning in preProcess.default(thresh = 0.95, k = 5, method
## = c("expoTrans", : These variables have zero variances:
## Hhold.fctrPKn:.clusterid.fctr4, Hhold.fctrSKn:.clusterid.fctr4,
## Hhold.fctrSKy:.clusterid.fctr4, YOB.Age.fctrNA:YOB.Age.dff
## [1] "myfit_mdl: train complete: 49.684000 secs"

##             Length Class      Mode     
## a0             79  -none-     numeric  
## beta        20540  dgCMatrix  S4       
## df             79  -none-     numeric  
## dim             2  -none-     numeric  
## lambda         79  -none-     numeric  
## dev.ratio      79  -none-     numeric  
## nulldev         1  -none-     numeric  
## npasses         1  -none-     numeric  
## jerr            1  -none-     numeric  
## offset          1  -none-     logical  
## classnames      2  -none-     character
## call            5  -none-     call     
## nobs            1  -none-     numeric  
## lambdaOpt       1  -none-     numeric  
## xNames        260  -none-     character
## problemType     1  -none-     character
## tuneValue       2  data.frame list     
## obsLevels       2  -none-     character
## [1] "min lambda > lambdaOpt:"
##                     (Intercept)                   Hhold.fctrMKy 
##                      0.31967158                      0.17044108 
##                   Hhold.fctrPKn                   Hhold.fctrPKy 
##                     -0.70076433                     -0.43785935 
##                   Income.fctr.Q                   Income.fctr^6 
##                      0.13626004                     -0.07125976 
##                 Q101163.fctrDad                  Q106272.fctrNo 
##                      0.94827993                     -0.28578376 
##                  Q106997.fctrGr                Q108855.fctrYes! 
##                      0.44710755                      0.27724752 
##                  Q110740.fctrPC                  Q113181.fctrNo 
##                      0.44766624                     -1.48092661 
##                 Q113181.fctrYes                  Q115611.fctrNo 
##                      0.76849888                     -0.72420162 
##                 Q115611.fctrYes                  Q115899.fctrCs 
##                      2.10906887                     -0.03855171 
##               Q116881.fctrRight                   Q98197.fctrNo 
##                      1.17244801                     -1.22486735 
##                   Q98869.fctrNo                   Q99480.fctrNo 
##                     -0.70827865                     -0.47301091 
##  Hhold.fctrPKn:.clusterid.fctr2  Hhold.fctrMKy:.clusterid.fctr4 
##                     -0.45120258                      0.41134195 
## YOB.Age.fctr(35,40]:YOB.Age.dff 
##                     -0.11820244 
## [1] "max lambda < lambdaOpt:"
##                     (Intercept)                   Hhold.fctrMKy 
##                      0.32000305                      0.20492060 
##                   Hhold.fctrPKn                   Hhold.fctrPKy 
##                     -0.76626059                     -0.56953233 
##                   Income.fctr.Q                   Income.fctr^6 
##                      0.23223093                     -0.16935738 
##                  Q100562.fctrNo                 Q101163.fctrDad 
##                     -0.07488300                      1.02453813 
##                  Q106272.fctrNo                  Q106997.fctrGr 
##                     -0.36297392                      0.59530148 
##                Q108855.fctrYes!                  Q110740.fctrPC 
##                      0.36312816                      0.54320298 
##                  Q113181.fctrNo                 Q113181.fctrYes 
##                     -1.53413324                      0.76056725 
##                  Q115611.fctrNo                 Q115611.fctrYes 
##                     -0.74313134                      2.16965670 
##                  Q115899.fctrCs               Q116881.fctrRight 
##                     -0.12899583                      1.25786772 
##                  Q116953.fctrNo                  Q118232.fctrId 
##                      0.08674197                     -0.04342297 
##             Q120472.fctrScience                  Q122120.fctrNo 
##                      0.08381197                     -0.09058921 
##                   Q98197.fctrNo                   Q98869.fctrNo 
##                     -1.26517343                     -0.78605038 
##                   Q99480.fctrNo                  Q99716.fctrYes 
##                     -0.54115654                     -0.04440177 
##  Hhold.fctrPKn:.clusterid.fctr2  Hhold.fctrMKy:.clusterid.fctr4 
##                     -0.53626183                      0.48139180 
## YOB.Age.fctr(35,40]:YOB.Age.dff 
##                     -0.23115125 
## [1] "myfit_mdl: train diagnostics complete: 50.299000 secs"

##          Prediction
## Reference    D    R
##         D  506  532
##         R  397 1024
##       Accuracy          Kappa  AccuracyLower  AccuracyUpper   AccuracyNull 
##   6.222041e-01   2.118076e-01   6.027014e-01   6.414154e-01   5.778772e-01 
## AccuracyPValue  McnemarPValue 
##   4.234474e-06   1.100624e-05 
## [1] "myfit_mdl: predict complete: 57.591000 secs"
##                                             id
## 1 Final.All.X#expoTrans.spatialSign#rcv#glmnet
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           feats
## 1 Q115611.fctr,Q113181.fctr,Q98197.fctr,Q116881.fctr,Q108855.fctr,Q106272.fctr,Q122771.fctr,Q123621.fctr,Q106388.fctr,Q110740.fctr,Q122769.fctr,Q120472.fctr,Q101596.fctr,Q119334.fctr,Q114152.fctr,Q98869.fctr,Q115899.fctr,Q116797.fctr,Q118232.fctr,Gender.fctr,Q105655.fctr,Q99480.fctr,Q123464.fctr,Q120650.fctr,Q122120.fctr,Q107869.fctr,Q120014.fctr,Q102289.fctr,Income.fctr,Q122770.fctr,Q111580.fctr,Q116601.fctr,Q117186.fctr,Q106993.fctr,Q112270.fctr,Q101162.fctr,Q108856.fctr,Q117193.fctr,Q116441.fctr,Q119851.fctr,Q111848.fctr,Q98578.fctr,Q118892.fctr,Q114386.fctr,Q120978.fctr,Q112512.fctr,Q102674.fctr,Q96024.fctr,Q108950.fctr,Q115610.fctr,YOB.Age.fctr,Q112478.fctr,Q116197.fctr,Q124742.fctr,Q106389.fctr,Edn.fctr,Q118117.fctr,Q100562.fctr,Q107491.fctr,Q116448.fctr,Q108754.fctr,Q116953.fctr,Q115602.fctr,Q118233.fctr,Q120012.fctr,Q118237.fctr,Q99581.fctr,.rnorm,Q120194.fctr,Q115777.fctr,Q106997.fctr,Q100680.fctr,Q113584.fctr,Q108343.fctr,Q121700.fctr,Q105840.fctr,Q120379.fctr,Q103293.fctr,Q124122.fctr,Q109367.fctr,Q113992.fctr,Q121699.fctr,Q121011.fctr,Q114748.fctr,Q106042.fctr,Q111220.fctr,Q114517.fctr,Q102687.fctr,Q102906.fctr,Q98078.fctr,Q115390.fctr,Q102089.fctr,Q100010.fctr,Q99982.fctr,Q113583.fctr,Q108342.fctr,Q104996.fctr,Q119650.fctr,Q100689.fctr,Q108617.fctr,Q115195.fctr,Q99716.fctr,Q101163.fctr,Q98059.fctr,Q114961.fctr,Hhold.fctr,Hhold.fctr:.clusterid.fctr,YOB.Age.fctr:YOB.Age.dff
##   max.nTuningRuns min.elapsedtime.everything min.elapsedtime.final
## 1              25                     48.902                  3.79
##   max.AUCpROC.fit max.Sens.fit max.Spec.fit max.AUCROCR.fit
## 1        0.570395    0.2899807    0.8508093       0.6530192
##   opt.prob.threshold.fit max.f.score.fit max.Accuracy.fit
## 1                   0.55       0.6879409        0.5991618
##   max.AccuracyLower.fit max.AccuracyUpper.fit max.Kappa.fit
## 1             0.6027014             0.6414154     0.1180901
##   max.AccuracySD.fit max.KappaSD.fit
## 1         0.01413901      0.02885074
## [1] "myfit_mdl: exit: 57.616000 secs"
rm(ret_lst)
glb_chunks_df <- myadd_chunk(glb_chunks_df, "fit.data.training", major.inc=FALSE)
##               label step_major step_minor label_minor     bgn     end
## 4 fit.data.training          2          0           0 600.612 658.729
## 5 fit.data.training          2          1           1 658.730      NA
##   elapsed
## 4  58.117
## 5      NA
#stop(here"); glb2Sav()
if (glb_is_classification && glb_is_binomial) 
    prob_threshold <- glb_models_df[glb_models_df$id == glbMdlSelId,
                                        "opt.prob.threshold.OOB"] else 
    prob_threshold <- NULL

if (grepl("Ensemble", glbMdlFinId)) {
    # Get predictions for each model in ensemble; Outliers that have been moved to OOB might not have been predicted yet
    mdlEnsembleComps <- unlist(str_split(subset(glb_models_df, 
                                                id == glbMdlFinId)$feats, ","))
    if (glb_is_classification)
    #     mdlEnsembleComps <- gsub("\\.prob$", "", mdlEnsembleComps)
    # mdlEnsembleComps <- gsub(paste0("^", 
    #                     gsub(".", "\\.", mygetPredictIds(glb_rsp_var)$value, fixed = TRUE)),
    #                          "", mdlEnsembleComps)
        mdlEnsembleComps <- glb_models_df$id[sapply(glb_models_df$id, function(thsMdlId)
                        mygetPredictIds(glb_rsp_var, thsMdlId)$prob  %in% mdlEnsembleComps)] else
        mdlEnsembleComps <- glb_models_df$id[sapply(glb_models_df$id, function(thsMdlId)
                        mygetPredictIds(glb_rsp_var, thsMdlId)$value  %in% mdlEnsembleComps)]
                        
    for (mdl_id in mdlEnsembleComps) {
        glbObsTrn <- glb_get_predictions(df = glbObsTrn, mdl_id = mdl_id, 
                                            rsp_var = glb_rsp_var,
                                            prob_threshold_def = prob_threshold)
        glbObsNew <- glb_get_predictions(df = glbObsNew, mdl_id = mdl_id, 
                                            rsp_var = glb_rsp_var,
                                            prob_threshold_def = prob_threshold)
        # glb_fin_mdl uses the same coefficients as glb_sel_mdl, 
        #   so copy the "Final" columns into "non-Final" columns
        glbObsTrn[, gsub("Final.", "", unlist(mygetPredictIds(glb_rsp_var, mdl_id)))] <-
            glbObsTrn[, unlist(mygetPredictIds(glb_rsp_var, mdl_id))]
        glbObsNew[, gsub("Final.", "", unlist(mygetPredictIds(glb_rsp_var, mdl_id)))] <-
            glbObsNew[, unlist(mygetPredictIds(glb_rsp_var, mdl_id))]
    }    
}
glbObsTrn <- glb_get_predictions(df = glbObsTrn, mdl_id = glbMdlFinId, 
                                     rsp_var = glb_rsp_var,
                                    prob_threshold_def = prob_threshold)
## Warning in glb_get_predictions(df = glbObsTrn, mdl_id = glbMdlFinId,
## rsp_var = glb_rsp_var, : Using default probability threshold: 0.45
glb_featsimp_df <- myget_feats_importance(mdl=glb_fin_mdl,
                                          featsimp_df=glb_featsimp_df)
#glb_featsimp_df[, paste0(glbMdlFinId, ".imp")] <- glb_featsimp_df$imp
print(glb_featsimp_df)
##                                 All.X.expoTrans.spatialSign.rcv.glmnet.imp
## Q115611.fctrYes                                                100.0000000
## Q113181.fctrNo                                                  95.3534018
## Q98197.fctrNo                                                   51.2895374
## Q116881.fctrRight                                               63.5102201
## Q101163.fctrDad                                                 52.9462718
## Q113181.fctrYes                                                 37.0837563
## Q98869.fctrNo                                                   53.8392977
## Q115611.fctrNo                                                  33.9313892
## Hhold.fctrPKn                                                   72.3736413
## Q106997.fctrGr                                                  53.8293468
## Q99480.fctrNo                                                   54.7705038
## Hhold.fctrPKy                                                   48.8973726
## Q110740.fctrPC                                                  16.2478906
## Hhold.fctrPKn:.clusterid.fctr2                                   0.0000000
## Hhold.fctrMKy:.clusterid.fctr4                                  13.1648041
## Q106272.fctrNo                                                  28.7696462
## Q108855.fctrYes!                                                 1.0727486
## Hhold.fctrMKy                                                   32.0285479
## Income.fctr.Q                                                   18.7794022
## YOB.Age.fctr(35,40]:YOB.Age.dff                                 14.9297986
## Income.fctr^6                                                   14.3529560
## Q115899.fctrCs                                                  17.7016232
## Q122120.fctrNo                                                   0.0000000
## Q116953.fctrNo                                                  12.4240036
## Q120472.fctrScience                                             19.0457801
## Q100562.fctrNo                                                  21.9532492
## Q99716.fctrYes                                                  12.6078177
## Q118232.fctrId                                                   0.0000000
## .rnorm                                                           0.0000000
## Edn.fctr.C                                                       0.0000000
## Edn.fctr.L                                                       0.0000000
## Edn.fctr.Q                                                       0.0000000
## Edn.fctr^4                                                       0.0000000
## Edn.fctr^5                                                       0.0000000
## Edn.fctr^6                                                       0.0000000
## Edn.fctr^7                                                       0.0000000
## Gender.fctrF                                                     0.0000000
## Gender.fctrM                                                     0.0000000
## Hhold.fctrMKn                                                    0.0000000
## Hhold.fctrMKn:.clusterid.fctr2                                   0.0000000
## Hhold.fctrMKn:.clusterid.fctr3                                   0.0000000
## Hhold.fctrMKn:.clusterid.fctr4                                   0.0000000
## Hhold.fctrMKy:.clusterid.fctr2                                   0.0000000
## Hhold.fctrMKy:.clusterid.fctr3                                   0.0000000
## Hhold.fctrN:.clusterid.fctr2                                     0.0000000
## Hhold.fctrN:.clusterid.fctr3                                     0.0000000
## Hhold.fctrN:.clusterid.fctr4                                    13.2538905
## Hhold.fctrPKn:.clusterid.fctr3                                   0.0000000
## Hhold.fctrPKn:.clusterid.fctr4                                   0.0000000
## Hhold.fctrPKy:.clusterid.fctr2                                   0.0000000
## Hhold.fctrPKy:.clusterid.fctr3                                   0.0000000
## Hhold.fctrPKy:.clusterid.fctr4                                  24.0708883
## Hhold.fctrSKn                                                    0.0000000
## Hhold.fctrSKn:.clusterid.fctr2                                  11.3977291
## Hhold.fctrSKn:.clusterid.fctr3                                   0.0000000
## Hhold.fctrSKn:.clusterid.fctr4                                   0.0000000
## Hhold.fctrSKy                                                   14.5868679
## Hhold.fctrSKy:.clusterid.fctr2                                   0.0000000
## Hhold.fctrSKy:.clusterid.fctr3                                  13.9491938
## Hhold.fctrSKy:.clusterid.fctr4                                   0.0000000
## Income.fctr.C                                                   23.6556411
## Income.fctr.L                                                    0.0000000
## Income.fctr^4                                                    0.0000000
## Income.fctr^5                                                    0.0000000
## Q100010.fctrNo                                                   0.0000000
## Q100010.fctrYes                                                  0.0000000
## Q100562.fctrYes                                                  0.0000000
## Q100680.fctrNo                                                   0.0000000
## Q100680.fctrYes                                                  0.0000000
## Q100689.fctrNo                                                   0.0000000
## Q100689.fctrYes                                                  0.1638523
## Q101162.fctrOptimist                                             0.0000000
## Q101162.fctrPessimist                                            0.0000000
## Q101163.fctrMom                                                  0.0000000
## Q101596.fctrNo                                                   0.0000000
## Q101596.fctrYes                                                  0.0000000
## Q102089.fctrOwn                                                  4.0312831
## Q102089.fctrRent                                                 0.0000000
## Q102289.fctrNo                                                   0.0000000
## Q102289.fctrYes                                                  0.0000000
## Q102674.fctrNo                                                   0.0000000
## Q102674.fctrYes                                                  0.0000000
## Q102687.fctrNo                                                   0.0000000
## Q102687.fctrYes                                                  0.0000000
## Q102906.fctrNo                                                   0.0000000
## Q102906.fctrYes                                                  0.0000000
## Q103293.fctrNo                                                   0.0000000
## Q103293.fctrYes                                                  0.0000000
## Q104996.fctrNo                                                   0.0000000
## Q104996.fctrYes                                                 13.3267802
## Q105655.fctrNo                                                   0.0000000
## Q105655.fctrYes                                                 28.1499086
## Q105840.fctrNo                                                   0.0000000
## Q105840.fctrYes                                                  0.0000000
## Q106042.fctrNo                                                   0.0000000
## Q106042.fctrYes                                                  0.0000000
## Q106272.fctrYes                                                  0.9188083
## Q106388.fctrNo                                                   0.0000000
## Q106388.fctrYes                                                  0.0000000
## Q106389.fctrNo                                                   0.0000000
## Q106389.fctrYes                                                  0.0000000
## Q106993.fctrNo                                                   0.0000000
## Q106993.fctrYes                                                  0.0000000
## Q106997.fctrYy                                                   0.0000000
## Q107491.fctrNo                                                   0.0000000
## Q107491.fctrYes                                                  0.0000000
## Q107869.fctrNo                                                   0.0000000
## Q107869.fctrYes                                                  0.0000000
## Q108342.fctrIn-person                                            0.0000000
## Q108342.fctrOnline                                               0.0000000
## Q108343.fctrNo                                                   0.0000000
## Q108343.fctrYes                                                  0.0000000
## Q108617.fctrNo                                                   0.0000000
## Q108617.fctrYes                                                  0.0000000
## Q108754.fctrNo                                                   0.0000000
## Q108754.fctrYes                                                  0.0000000
## Q108855.fctrUmm...                                              14.1070607
## Q108856.fctrSocialize                                            0.0000000
## Q108856.fctrSpace                                                0.0000000
## Q108950.fctrCautious                                             0.0000000
## Q108950.fctrRisk-friendly                                        0.0000000
## Q109367.fctrNo                                                  21.4635778
## Q109367.fctrYes                                                  8.8146390
## Q110740.fctrMac                                                  0.0000000
## Q111220.fctrNo                                                   0.0000000
## Q111220.fctrYes                                                  0.0000000
## Q111580.fctrDemanding                                            0.0000000
## Q111580.fctrSupportive                                           0.0000000
## Q111848.fctrNo                                                   0.0000000
## Q111848.fctrYes                                                  0.0000000
## Q112270.fctrNo                                                   0.0000000
## Q112270.fctrYes                                                  0.0000000
## Q112478.fctrNo                                                   0.0000000
## Q112478.fctrYes                                                  0.0000000
## Q112512.fctrNo                                                   0.0000000
## Q112512.fctrYes                                                  0.0000000
## Q113583.fctrTalk                                                 0.0000000
## Q113583.fctrTunes                                                0.0000000
## Q113584.fctrPeople                                               0.0000000
## Q113584.fctrTechnology                                           0.0000000
## Q113992.fctrNo                                                   0.0000000
## Q113992.fctrYes                                                  0.0000000
## Q114152.fctrNo                                                   0.0000000
## Q114152.fctrYes                                                  0.0000000
## Q114386.fctrMysterious                                           7.6865479
## Q114386.fctrTMI                                                  0.0000000
## Q114517.fctrNo                                                  26.3106333
## Q114517.fctrYes                                                  0.0000000
## Q114748.fctrNo                                                   0.0000000
## Q114748.fctrYes                                                  0.0000000
## Q114961.fctrNo                                                   0.0000000
## Q114961.fctrYes                                                  0.0000000
## Q115195.fctrNo                                                   0.0000000
## Q115195.fctrYes                                                  0.0000000
## Q115390.fctrNo                                                   0.0000000
## Q115390.fctrYes                                                  0.0000000
## Q115602.fctrNo                                                   0.0000000
## Q115602.fctrYes                                                  0.0000000
## Q115610.fctrNo                                                   0.0000000
## Q115610.fctrYes                                                  0.0000000
## Q115777.fctrEnd                                                  0.0000000
## Q115777.fctrStart                                                0.0000000
## Q115899.fctrMe                                                   0.0000000
## Q116197.fctrA.M.                                                 0.0000000
## Q116197.fctrP.M.                                                 0.0000000
## Q116441.fctrNo                                                   0.0000000
## Q116441.fctrYes                                                  0.0000000
## Q116448.fctrNo                                                   0.0000000
## Q116448.fctrYes                                                  0.0000000
## Q116601.fctrNo                                                   5.7800906
## Q116601.fctrYes                                                  0.0000000
## Q116797.fctrNo                                                   0.0000000
## Q116797.fctrYes                                                  0.0000000
## Q116881.fctrHappy                                               16.8262843
## Q116953.fctrYes                                                  0.0000000
## Q117186.fctrCool headed                                          0.0000000
## Q117186.fctrHot headed                                           0.0000000
## Q117193.fctrOdd hours                                            0.0000000
## Q117193.fctrStandard hours                                       3.5026709
## Q118117.fctrNo                                                   0.0000000
## Q118117.fctrYes                                                  0.0000000
## Q118232.fctrPr                                                   0.0000000
## Q118233.fctrNo                                                   0.0000000
## Q118233.fctrYes                                                  0.0000000
## Q118237.fctrNo                                                   0.0000000
## Q118237.fctrYes                                                  0.0000000
## Q118892.fctrNo                                                  16.9276058
## Q118892.fctrYes                                                  0.0000000
## Q119334.fctrNo                                                   0.0000000
## Q119334.fctrYes                                                  0.0000000
## Q119650.fctrGiving                                              35.7211724
## Q119650.fctrReceiving                                            0.0000000
## Q119851.fctrNo                                                   0.0000000
## Q119851.fctrYes                                                  0.0000000
## Q120012.fctrNo                                                   0.0000000
## Q120012.fctrYes                                                  0.0000000
## Q120014.fctrNo                                                   0.0000000
## Q120014.fctrYes                                                  0.0000000
## Q120194.fctrStudy first                                          0.0000000
## Q120194.fctrTry first                                            0.0000000
## Q120379.fctrNo                                                   0.0000000
## Q120379.fctrYes                                                  5.4427713
## Q120472.fctrArt                                                  0.0000000
## Q120650.fctrNo                                                   0.0000000
## Q120650.fctrYes                                                  0.0000000
## Q120978.fctrNo                                                   0.0000000
## Q120978.fctrYes                                                  0.0000000
## Q121011.fctrNo                                                   0.0000000
## Q121011.fctrYes                                                  0.0000000
## Q121699.fctrNo                                                   0.0000000
## Q121699.fctrYes                                                  0.0000000
## Q121700.fctrNo                                                   0.0000000
## Q121700.fctrYes                                                  0.0000000
## Q122120.fctrYes                                                  0.0000000
## Q122769.fctrNo                                                   0.0000000
## Q122769.fctrYes                                                  3.6547887
## Q122770.fctrNo                                                   0.0000000
## Q122770.fctrYes                                                  0.0000000
## Q122771.fctrPc                                                   0.0000000
## Q122771.fctrPt                                                   0.4572496
## Q123464.fctrNo                                                   0.0000000
## Q123464.fctrYes                                                  0.0000000
## Q123621.fctrNo                                                   0.0000000
## Q123621.fctrYes                                                 24.3374872
## Q124122.fctrNo                                                   0.0000000
## Q124122.fctrYes                                                  0.0000000
## Q124742.fctrNo                                                  33.9726792
## Q124742.fctrYes                                                  0.0000000
## Q96024.fctrNo                                                    1.1407544
## Q96024.fctrYes                                                   0.0000000
## Q98059.fctrOnly-child                                            0.0000000
## Q98059.fctrYes                                                   0.0000000
## Q98078.fctrNo                                                    0.0000000
## Q98078.fctrYes                                                   0.0000000
## Q98197.fctrYes                                                   0.0000000
## Q98578.fctrNo                                                    0.0000000
## Q98578.fctrYes                                                   0.0000000
## Q98869.fctrYes                                                   0.0000000
## Q99480.fctrYes                                                   0.1700106
## Q99581.fctrNo                                                    0.0000000
## Q99581.fctrYes                                                   0.0000000
## Q99716.fctrNo                                                    0.0000000
## Q99982.fctrCheck!                                                0.0000000
## Q99982.fctrNope                                                  0.0000000
## YOB.Age.fctr(15,20]:YOB.Age.dff                                  0.0000000
## YOB.Age.fctr(20,25]:YOB.Age.dff                                  0.0000000
## YOB.Age.fctr(25,30]:YOB.Age.dff                                  0.6262704
## YOB.Age.fctr(30,35]:YOB.Age.dff                                  0.0000000
## YOB.Age.fctr(40,50]:YOB.Age.dff                                  0.0000000
## YOB.Age.fctr(50,65]:YOB.Age.dff                                  0.0000000
## YOB.Age.fctr(65,90]:YOB.Age.dff                                  0.1756714
## YOB.Age.fctr.C                                                   0.0000000
## YOB.Age.fctr.L                                                   0.0000000
## YOB.Age.fctr.Q                                                   0.0000000
## YOB.Age.fctrNA:YOB.Age.dff                                       0.0000000
## YOB.Age.fctr^4                                                   0.0000000
## YOB.Age.fctr^5                                                   0.0000000
## YOB.Age.fctr^6                                                   0.0000000
## YOB.Age.fctr^7                                                   0.0000000
## YOB.Age.fctr^8                                                   0.0000000
##                                 Final.All.X.expoTrans.spatialSign.rcv.glmnet.imp
## Q115611.fctrYes                                                      100.0000000
## Q113181.fctrNo                                                        70.4599840
## Q98197.fctrNo                                                         58.1928167
## Q116881.fctrRight                                                     56.7693170
## Q101163.fctrDad                                                       46.0785490
## Q113181.fctrYes                                                       35.7542760
## Q98869.fctrNo                                                         34.8905841
## Q115611.fctrNo                                                        34.2948032
## Hhold.fctrPKn                                                         34.2595973
## Q106997.fctrGr                                                        24.2823620
## Q99480.fctrNo                                                         23.6702142
## Hhold.fctrPKy                                                         23.4735931
## Q110740.fctrPC                                                        23.1090302
## Hhold.fctrPKn:.clusterid.fctr2                                        23.0357267
## Hhold.fctrMKy:.clusterid.fctr4                                        20.8299540
## Q106272.fctrNo                                                        15.1215088
## Q108855.fctrYes!                                                      14.9203118
## Hhold.fctrMKy                                                          8.7552062
## Income.fctr.Q                                                          8.5575899
## YOB.Age.fctr(35,40]:YOB.Age.dff                                        8.0999511
## Income.fctr^6                                                          5.5666257
## Q115899.fctrCs                                                         3.8628641
## Q122120.fctrNo                                                         2.0634941
## Q116953.fctrNo                                                         1.9758594
## Q120472.fctrScience                                                    1.9091181
## Q100562.fctrNo                                                         1.7057288
## Q99716.fctrYes                                                         1.0114096
## Q118232.fctrId                                                         0.9891138
## .rnorm                                                                 0.0000000
## Edn.fctr.C                                                             0.0000000
## Edn.fctr.L                                                             0.0000000
## Edn.fctr.Q                                                             0.0000000
## Edn.fctr^4                                                             0.0000000
## Edn.fctr^5                                                             0.0000000
## Edn.fctr^6                                                             0.0000000
## Edn.fctr^7                                                             0.0000000
## Gender.fctrF                                                           0.0000000
## Gender.fctrM                                                           0.0000000
## Hhold.fctrMKn                                                          0.0000000
## Hhold.fctrMKn:.clusterid.fctr2                                         0.0000000
## Hhold.fctrMKn:.clusterid.fctr3                                         0.0000000
## Hhold.fctrMKn:.clusterid.fctr4                                         0.0000000
## Hhold.fctrMKy:.clusterid.fctr2                                         0.0000000
## Hhold.fctrMKy:.clusterid.fctr3                                         0.0000000
## Hhold.fctrN:.clusterid.fctr2                                           0.0000000
## Hhold.fctrN:.clusterid.fctr3                                           0.0000000
## Hhold.fctrN:.clusterid.fctr4                                           0.0000000
## Hhold.fctrPKn:.clusterid.fctr3                                         0.0000000
## Hhold.fctrPKn:.clusterid.fctr4                                         0.0000000
## Hhold.fctrPKy:.clusterid.fctr2                                         0.0000000
## Hhold.fctrPKy:.clusterid.fctr3                                         0.0000000
## Hhold.fctrPKy:.clusterid.fctr4                                         0.0000000
## Hhold.fctrSKn                                                          0.0000000
## Hhold.fctrSKn:.clusterid.fctr2                                         0.0000000
## Hhold.fctrSKn:.clusterid.fctr3                                         0.0000000
## Hhold.fctrSKn:.clusterid.fctr4                                         0.0000000
## Hhold.fctrSKy                                                          0.0000000
## Hhold.fctrSKy:.clusterid.fctr2                                         0.0000000
## Hhold.fctrSKy:.clusterid.fctr3                                         0.0000000
## Hhold.fctrSKy:.clusterid.fctr4                                         0.0000000
## Income.fctr.C                                                          0.0000000
## Income.fctr.L                                                          0.0000000
## Income.fctr^4                                                          0.0000000
## Income.fctr^5                                                          0.0000000
## Q100010.fctrNo                                                         0.0000000
## Q100010.fctrYes                                                        0.0000000
## Q100562.fctrYes                                                        0.0000000
## Q100680.fctrNo                                                         0.0000000
## Q100680.fctrYes                                                        0.0000000
## Q100689.fctrNo                                                         0.0000000
## Q100689.fctrYes                                                        0.0000000
## Q101162.fctrOptimist                                                   0.0000000
## Q101162.fctrPessimist                                                  0.0000000
## Q101163.fctrMom                                                        0.0000000
## Q101596.fctrNo                                                         0.0000000
## Q101596.fctrYes                                                        0.0000000
## Q102089.fctrOwn                                                        0.0000000
## Q102089.fctrRent                                                       0.0000000
## Q102289.fctrNo                                                         0.0000000
## Q102289.fctrYes                                                        0.0000000
## Q102674.fctrNo                                                         0.0000000
## Q102674.fctrYes                                                        0.0000000
## Q102687.fctrNo                                                         0.0000000
## Q102687.fctrYes                                                        0.0000000
## Q102906.fctrNo                                                         0.0000000
## Q102906.fctrYes                                                        0.0000000
## Q103293.fctrNo                                                         0.0000000
## Q103293.fctrYes                                                        0.0000000
## Q104996.fctrNo                                                         0.0000000
## Q104996.fctrYes                                                        0.0000000
## Q105655.fctrNo                                                         0.0000000
## Q105655.fctrYes                                                        0.0000000
## Q105840.fctrNo                                                         0.0000000
## Q105840.fctrYes                                                        0.0000000
## Q106042.fctrNo                                                         0.0000000
## Q106042.fctrYes                                                        0.0000000
## Q106272.fctrYes                                                        0.0000000
## Q106388.fctrNo                                                         0.0000000
## Q106388.fctrYes                                                        0.0000000
## Q106389.fctrNo                                                         0.0000000
## Q106389.fctrYes                                                        0.0000000
## Q106993.fctrNo                                                         0.0000000
## Q106993.fctrYes                                                        0.0000000
## Q106997.fctrYy                                                         0.0000000
## Q107491.fctrNo                                                         0.0000000
## Q107491.fctrYes                                                        0.0000000
## Q107869.fctrNo                                                         0.0000000
## Q107869.fctrYes                                                        0.0000000
## Q108342.fctrIn-person                                                  0.0000000
## Q108342.fctrOnline                                                     0.0000000
## Q108343.fctrNo                                                         0.0000000
## Q108343.fctrYes                                                        0.0000000
## Q108617.fctrNo                                                         0.0000000
## Q108617.fctrYes                                                        0.0000000
## Q108754.fctrNo                                                         0.0000000
## Q108754.fctrYes                                                        0.0000000
## Q108855.fctrUmm...                                                     0.0000000
## Q108856.fctrSocialize                                                  0.0000000
## Q108856.fctrSpace                                                      0.0000000
## Q108950.fctrCautious                                                   0.0000000
## Q108950.fctrRisk-friendly                                              0.0000000
## Q109367.fctrNo                                                         0.0000000
## Q109367.fctrYes                                                        0.0000000
## Q110740.fctrMac                                                        0.0000000
## Q111220.fctrNo                                                         0.0000000
## Q111220.fctrYes                                                        0.0000000
## Q111580.fctrDemanding                                                  0.0000000
## Q111580.fctrSupportive                                                 0.0000000
## Q111848.fctrNo                                                         0.0000000
## Q111848.fctrYes                                                        0.0000000
## Q112270.fctrNo                                                         0.0000000
## Q112270.fctrYes                                                        0.0000000
## Q112478.fctrNo                                                         0.0000000
## Q112478.fctrYes                                                        0.0000000
## Q112512.fctrNo                                                         0.0000000
## Q112512.fctrYes                                                        0.0000000
## Q113583.fctrTalk                                                       0.0000000
## Q113583.fctrTunes                                                      0.0000000
## Q113584.fctrPeople                                                     0.0000000
## Q113584.fctrTechnology                                                 0.0000000
## Q113992.fctrNo                                                         0.0000000
## Q113992.fctrYes                                                        0.0000000
## Q114152.fctrNo                                                         0.0000000
## Q114152.fctrYes                                                        0.0000000
## Q114386.fctrMysterious                                                 0.0000000
## Q114386.fctrTMI                                                        0.0000000
## Q114517.fctrNo                                                         0.0000000
## Q114517.fctrYes                                                        0.0000000
## Q114748.fctrNo                                                         0.0000000
## Q114748.fctrYes                                                        0.0000000
## Q114961.fctrNo                                                         0.0000000
## Q114961.fctrYes                                                        0.0000000
## Q115195.fctrNo                                                         0.0000000
## Q115195.fctrYes                                                        0.0000000
## Q115390.fctrNo                                                         0.0000000
## Q115390.fctrYes                                                        0.0000000
## Q115602.fctrNo                                                         0.0000000
## Q115602.fctrYes                                                        0.0000000
## Q115610.fctrNo                                                         0.0000000
## Q115610.fctrYes                                                        0.0000000
## Q115777.fctrEnd                                                        0.0000000
## Q115777.fctrStart                                                      0.0000000
## Q115899.fctrMe                                                         0.0000000
## Q116197.fctrA.M.                                                       0.0000000
## Q116197.fctrP.M.                                                       0.0000000
## Q116441.fctrNo                                                         0.0000000
## Q116441.fctrYes                                                        0.0000000
## Q116448.fctrNo                                                         0.0000000
## Q116448.fctrYes                                                        0.0000000
## Q116601.fctrNo                                                         0.0000000
## Q116601.fctrYes                                                        0.0000000
## Q116797.fctrNo                                                         0.0000000
## Q116797.fctrYes                                                        0.0000000
## Q116881.fctrHappy                                                      0.0000000
## Q116953.fctrYes                                                        0.0000000
## Q117186.fctrCool headed                                                0.0000000
## Q117186.fctrHot headed                                                 0.0000000
## Q117193.fctrOdd hours                                                  0.0000000
## Q117193.fctrStandard hours                                             0.0000000
## Q118117.fctrNo                                                         0.0000000
## Q118117.fctrYes                                                        0.0000000
## Q118232.fctrPr                                                         0.0000000
## Q118233.fctrNo                                                         0.0000000
## Q118233.fctrYes                                                        0.0000000
## Q118237.fctrNo                                                         0.0000000
## Q118237.fctrYes                                                        0.0000000
## Q118892.fctrNo                                                         0.0000000
## Q118892.fctrYes                                                        0.0000000
## Q119334.fctrNo                                                         0.0000000
## Q119334.fctrYes                                                        0.0000000
## Q119650.fctrGiving                                                     0.0000000
## Q119650.fctrReceiving                                                  0.0000000
## Q119851.fctrNo                                                         0.0000000
## Q119851.fctrYes                                                        0.0000000
## Q120012.fctrNo                                                         0.0000000
## Q120012.fctrYes                                                        0.0000000
## Q120014.fctrNo                                                         0.0000000
## Q120014.fctrYes                                                        0.0000000
## Q120194.fctrStudy first                                                0.0000000
## Q120194.fctrTry first                                                  0.0000000
## Q120379.fctrNo                                                         0.0000000
## Q120379.fctrYes                                                        0.0000000
## Q120472.fctrArt                                                        0.0000000
## Q120650.fctrNo                                                         0.0000000
## Q120650.fctrYes                                                        0.0000000
## Q120978.fctrNo                                                         0.0000000
## Q120978.fctrYes                                                        0.0000000
## Q121011.fctrNo                                                         0.0000000
## Q121011.fctrYes                                                        0.0000000
## Q121699.fctrNo                                                         0.0000000
## Q121699.fctrYes                                                        0.0000000
## Q121700.fctrNo                                                         0.0000000
## Q121700.fctrYes                                                        0.0000000
## Q122120.fctrYes                                                        0.0000000
## Q122769.fctrNo                                                         0.0000000
## Q122769.fctrYes                                                        0.0000000
## Q122770.fctrNo                                                         0.0000000
## Q122770.fctrYes                                                        0.0000000
## Q122771.fctrPc                                                         0.0000000
## Q122771.fctrPt                                                         0.0000000
## Q123464.fctrNo                                                         0.0000000
## Q123464.fctrYes                                                        0.0000000
## Q123621.fctrNo                                                         0.0000000
## Q123621.fctrYes                                                        0.0000000
## Q124122.fctrNo                                                         0.0000000
## Q124122.fctrYes                                                        0.0000000
## Q124742.fctrNo                                                         0.0000000
## Q124742.fctrYes                                                        0.0000000
## Q96024.fctrNo                                                          0.0000000
## Q96024.fctrYes                                                         0.0000000
## Q98059.fctrOnly-child                                                  0.0000000
## Q98059.fctrYes                                                         0.0000000
## Q98078.fctrNo                                                          0.0000000
## Q98078.fctrYes                                                         0.0000000
## Q98197.fctrYes                                                         0.0000000
## Q98578.fctrNo                                                          0.0000000
## Q98578.fctrYes                                                         0.0000000
## Q98869.fctrYes                                                         0.0000000
## Q99480.fctrYes                                                         0.0000000
## Q99581.fctrNo                                                          0.0000000
## Q99581.fctrYes                                                         0.0000000
## Q99716.fctrNo                                                          0.0000000
## Q99982.fctrCheck!                                                      0.0000000
## Q99982.fctrNope                                                        0.0000000
## YOB.Age.fctr(15,20]:YOB.Age.dff                                        0.0000000
## YOB.Age.fctr(20,25]:YOB.Age.dff                                        0.0000000
## YOB.Age.fctr(25,30]:YOB.Age.dff                                        0.0000000
## YOB.Age.fctr(30,35]:YOB.Age.dff                                        0.0000000
## YOB.Age.fctr(40,50]:YOB.Age.dff                                        0.0000000
## YOB.Age.fctr(50,65]:YOB.Age.dff                                        0.0000000
## YOB.Age.fctr(65,90]:YOB.Age.dff                                        0.0000000
## YOB.Age.fctr.C                                                         0.0000000
## YOB.Age.fctr.L                                                         0.0000000
## YOB.Age.fctr.Q                                                         0.0000000
## YOB.Age.fctrNA:YOB.Age.dff                                             0.0000000
## YOB.Age.fctr^4                                                         0.0000000
## YOB.Age.fctr^5                                                         0.0000000
## YOB.Age.fctr^6                                                         0.0000000
## YOB.Age.fctr^7                                                         0.0000000
## YOB.Age.fctr^8                                                         0.0000000
##                                         imp
## Q115611.fctrYes                 100.0000000
## Q113181.fctrNo                   70.4599840
## Q98197.fctrNo                    58.1928167
## Q116881.fctrRight                56.7693170
## Q101163.fctrDad                  46.0785490
## Q113181.fctrYes                  35.7542760
## Q98869.fctrNo                    34.8905841
## Q115611.fctrNo                   34.2948032
## Hhold.fctrPKn                    34.2595973
## Q106997.fctrGr                   24.2823620
## Q99480.fctrNo                    23.6702142
## Hhold.fctrPKy                    23.4735931
## Q110740.fctrPC                   23.1090302
## Hhold.fctrPKn:.clusterid.fctr2   23.0357267
## Hhold.fctrMKy:.clusterid.fctr4   20.8299540
## Q106272.fctrNo                   15.1215088
## Q108855.fctrYes!                 14.9203118
## Hhold.fctrMKy                     8.7552062
## Income.fctr.Q                     8.5575899
## YOB.Age.fctr(35,40]:YOB.Age.dff   8.0999511
## Income.fctr^6                     5.5666257
## Q115899.fctrCs                    3.8628641
## Q122120.fctrNo                    2.0634941
## Q116953.fctrNo                    1.9758594
## Q120472.fctrScience               1.9091181
## Q100562.fctrNo                    1.7057288
## Q99716.fctrYes                    1.0114096
## Q118232.fctrId                    0.9891138
## .rnorm                            0.0000000
## Edn.fctr.C                        0.0000000
## Edn.fctr.L                        0.0000000
## Edn.fctr.Q                        0.0000000
## Edn.fctr^4                        0.0000000
## Edn.fctr^5                        0.0000000
## Edn.fctr^6                        0.0000000
## Edn.fctr^7                        0.0000000
## Gender.fctrF                      0.0000000
## Gender.fctrM                      0.0000000
## Hhold.fctrMKn                     0.0000000
## Hhold.fctrMKn:.clusterid.fctr2    0.0000000
## Hhold.fctrMKn:.clusterid.fctr3    0.0000000
## Hhold.fctrMKn:.clusterid.fctr4    0.0000000
## Hhold.fctrMKy:.clusterid.fctr2    0.0000000
## Hhold.fctrMKy:.clusterid.fctr3    0.0000000
## Hhold.fctrN:.clusterid.fctr2      0.0000000
## Hhold.fctrN:.clusterid.fctr3      0.0000000
## Hhold.fctrN:.clusterid.fctr4      0.0000000
## Hhold.fctrPKn:.clusterid.fctr3    0.0000000
## Hhold.fctrPKn:.clusterid.fctr4    0.0000000
## Hhold.fctrPKy:.clusterid.fctr2    0.0000000
## Hhold.fctrPKy:.clusterid.fctr3    0.0000000
## Hhold.fctrPKy:.clusterid.fctr4    0.0000000
## Hhold.fctrSKn                     0.0000000
## Hhold.fctrSKn:.clusterid.fctr2    0.0000000
## Hhold.fctrSKn:.clusterid.fctr3    0.0000000
## Hhold.fctrSKn:.clusterid.fctr4    0.0000000
## Hhold.fctrSKy                     0.0000000
## Hhold.fctrSKy:.clusterid.fctr2    0.0000000
## Hhold.fctrSKy:.clusterid.fctr3    0.0000000
## Hhold.fctrSKy:.clusterid.fctr4    0.0000000
## Income.fctr.C                     0.0000000
## Income.fctr.L                     0.0000000
## Income.fctr^4                     0.0000000
## Income.fctr^5                     0.0000000
## Q100010.fctrNo                    0.0000000
## Q100010.fctrYes                   0.0000000
## Q100562.fctrYes                   0.0000000
## Q100680.fctrNo                    0.0000000
## Q100680.fctrYes                   0.0000000
## Q100689.fctrNo                    0.0000000
## Q100689.fctrYes                   0.0000000
## Q101162.fctrOptimist              0.0000000
## Q101162.fctrPessimist             0.0000000
## Q101163.fctrMom                   0.0000000
## Q101596.fctrNo                    0.0000000
## Q101596.fctrYes                   0.0000000
## Q102089.fctrOwn                   0.0000000
## Q102089.fctrRent                  0.0000000
## Q102289.fctrNo                    0.0000000
## Q102289.fctrYes                   0.0000000
## Q102674.fctrNo                    0.0000000
## Q102674.fctrYes                   0.0000000
## Q102687.fctrNo                    0.0000000
## Q102687.fctrYes                   0.0000000
## Q102906.fctrNo                    0.0000000
## Q102906.fctrYes                   0.0000000
## Q103293.fctrNo                    0.0000000
## Q103293.fctrYes                   0.0000000
## Q104996.fctrNo                    0.0000000
## Q104996.fctrYes                   0.0000000
## Q105655.fctrNo                    0.0000000
## Q105655.fctrYes                   0.0000000
## Q105840.fctrNo                    0.0000000
## Q105840.fctrYes                   0.0000000
## Q106042.fctrNo                    0.0000000
## Q106042.fctrYes                   0.0000000
## Q106272.fctrYes                   0.0000000
## Q106388.fctrNo                    0.0000000
## Q106388.fctrYes                   0.0000000
## Q106389.fctrNo                    0.0000000
## Q106389.fctrYes                   0.0000000
## Q106993.fctrNo                    0.0000000
## Q106993.fctrYes                   0.0000000
## Q106997.fctrYy                    0.0000000
## Q107491.fctrNo                    0.0000000
## Q107491.fctrYes                   0.0000000
## Q107869.fctrNo                    0.0000000
## Q107869.fctrYes                   0.0000000
## Q108342.fctrIn-person             0.0000000
## Q108342.fctrOnline                0.0000000
## Q108343.fctrNo                    0.0000000
## Q108343.fctrYes                   0.0000000
## Q108617.fctrNo                    0.0000000
## Q108617.fctrYes                   0.0000000
## Q108754.fctrNo                    0.0000000
## Q108754.fctrYes                   0.0000000
## Q108855.fctrUmm...                0.0000000
## Q108856.fctrSocialize             0.0000000
## Q108856.fctrSpace                 0.0000000
## Q108950.fctrCautious              0.0000000
## Q108950.fctrRisk-friendly         0.0000000
## Q109367.fctrNo                    0.0000000
## Q109367.fctrYes                   0.0000000
## Q110740.fctrMac                   0.0000000
## Q111220.fctrNo                    0.0000000
## Q111220.fctrYes                   0.0000000
## Q111580.fctrDemanding             0.0000000
## Q111580.fctrSupportive            0.0000000
## Q111848.fctrNo                    0.0000000
## Q111848.fctrYes                   0.0000000
## Q112270.fctrNo                    0.0000000
## Q112270.fctrYes                   0.0000000
## Q112478.fctrNo                    0.0000000
## Q112478.fctrYes                   0.0000000
## Q112512.fctrNo                    0.0000000
## Q112512.fctrYes                   0.0000000
## Q113583.fctrTalk                  0.0000000
## Q113583.fctrTunes                 0.0000000
## Q113584.fctrPeople                0.0000000
## Q113584.fctrTechnology            0.0000000
## Q113992.fctrNo                    0.0000000
## Q113992.fctrYes                   0.0000000
## Q114152.fctrNo                    0.0000000
## Q114152.fctrYes                   0.0000000
## Q114386.fctrMysterious            0.0000000
## Q114386.fctrTMI                   0.0000000
## Q114517.fctrNo                    0.0000000
## Q114517.fctrYes                   0.0000000
## Q114748.fctrNo                    0.0000000
## Q114748.fctrYes                   0.0000000
## Q114961.fctrNo                    0.0000000
## Q114961.fctrYes                   0.0000000
## Q115195.fctrNo                    0.0000000
## Q115195.fctrYes                   0.0000000
## Q115390.fctrNo                    0.0000000
## Q115390.fctrYes                   0.0000000
## Q115602.fctrNo                    0.0000000
## Q115602.fctrYes                   0.0000000
## Q115610.fctrNo                    0.0000000
## Q115610.fctrYes                   0.0000000
## Q115777.fctrEnd                   0.0000000
## Q115777.fctrStart                 0.0000000
## Q115899.fctrMe                    0.0000000
## Q116197.fctrA.M.                  0.0000000
## Q116197.fctrP.M.                  0.0000000
## Q116441.fctrNo                    0.0000000
## Q116441.fctrYes                   0.0000000
## Q116448.fctrNo                    0.0000000
## Q116448.fctrYes                   0.0000000
## Q116601.fctrNo                    0.0000000
## Q116601.fctrYes                   0.0000000
## Q116797.fctrNo                    0.0000000
## Q116797.fctrYes                   0.0000000
## Q116881.fctrHappy                 0.0000000
## Q116953.fctrYes                   0.0000000
## Q117186.fctrCool headed           0.0000000
## Q117186.fctrHot headed            0.0000000
## Q117193.fctrOdd hours             0.0000000
## Q117193.fctrStandard hours        0.0000000
## Q118117.fctrNo                    0.0000000
## Q118117.fctrYes                   0.0000000
## Q118232.fctrPr                    0.0000000
## Q118233.fctrNo                    0.0000000
## Q118233.fctrYes                   0.0000000
## Q118237.fctrNo                    0.0000000
## Q118237.fctrYes                   0.0000000
## Q118892.fctrNo                    0.0000000
## Q118892.fctrYes                   0.0000000
## Q119334.fctrNo                    0.0000000
## Q119334.fctrYes                   0.0000000
## Q119650.fctrGiving                0.0000000
## Q119650.fctrReceiving             0.0000000
## Q119851.fctrNo                    0.0000000
## Q119851.fctrYes                   0.0000000
## Q120012.fctrNo                    0.0000000
## Q120012.fctrYes                   0.0000000
## Q120014.fctrNo                    0.0000000
## Q120014.fctrYes                   0.0000000
## Q120194.fctrStudy first           0.0000000
## Q120194.fctrTry first             0.0000000
## Q120379.fctrNo                    0.0000000
## Q120379.fctrYes                   0.0000000
## Q120472.fctrArt                   0.0000000
## Q120650.fctrNo                    0.0000000
## Q120650.fctrYes                   0.0000000
## Q120978.fctrNo                    0.0000000
## Q120978.fctrYes                   0.0000000
## Q121011.fctrNo                    0.0000000
## Q121011.fctrYes                   0.0000000
## Q121699.fctrNo                    0.0000000
## Q121699.fctrYes                   0.0000000
## Q121700.fctrNo                    0.0000000
## Q121700.fctrYes                   0.0000000
## Q122120.fctrYes                   0.0000000
## Q122769.fctrNo                    0.0000000
## Q122769.fctrYes                   0.0000000
## Q122770.fctrNo                    0.0000000
## Q122770.fctrYes                   0.0000000
## Q122771.fctrPc                    0.0000000
## Q122771.fctrPt                    0.0000000
## Q123464.fctrNo                    0.0000000
## Q123464.fctrYes                   0.0000000
## Q123621.fctrNo                    0.0000000
## Q123621.fctrYes                   0.0000000
## Q124122.fctrNo                    0.0000000
## Q124122.fctrYes                   0.0000000
## Q124742.fctrNo                    0.0000000
## Q124742.fctrYes                   0.0000000
## Q96024.fctrNo                     0.0000000
## Q96024.fctrYes                    0.0000000
## Q98059.fctrOnly-child             0.0000000
## Q98059.fctrYes                    0.0000000
## Q98078.fctrNo                     0.0000000
## Q98078.fctrYes                    0.0000000
## Q98197.fctrYes                    0.0000000
## Q98578.fctrNo                     0.0000000
## Q98578.fctrYes                    0.0000000
## Q98869.fctrYes                    0.0000000
## Q99480.fctrYes                    0.0000000
## Q99581.fctrNo                     0.0000000
## Q99581.fctrYes                    0.0000000
## Q99716.fctrNo                     0.0000000
## Q99982.fctrCheck!                 0.0000000
## Q99982.fctrNope                   0.0000000
## YOB.Age.fctr(15,20]:YOB.Age.dff   0.0000000
## YOB.Age.fctr(20,25]:YOB.Age.dff   0.0000000
## YOB.Age.fctr(25,30]:YOB.Age.dff   0.0000000
## YOB.Age.fctr(30,35]:YOB.Age.dff   0.0000000
## YOB.Age.fctr(40,50]:YOB.Age.dff   0.0000000
## YOB.Age.fctr(50,65]:YOB.Age.dff   0.0000000
## YOB.Age.fctr(65,90]:YOB.Age.dff   0.0000000
## YOB.Age.fctr.C                    0.0000000
## YOB.Age.fctr.L                    0.0000000
## YOB.Age.fctr.Q                    0.0000000
## YOB.Age.fctrNA:YOB.Age.dff        0.0000000
## YOB.Age.fctr^4                    0.0000000
## YOB.Age.fctr^5                    0.0000000
## YOB.Age.fctr^6                    0.0000000
## YOB.Age.fctr^7                    0.0000000
## YOB.Age.fctr^8                    0.0000000
if (glb_is_classification && glb_is_binomial)
    glb_analytics_diag_plots(obs_df=glbObsTrn, mdl_id=glbMdlFinId, 
            prob_threshold=glb_models_df[glb_models_df$id == glbMdlSelId, 
                                         "opt.prob.threshold.OOB"]) else
    glb_analytics_diag_plots(obs_df=glbObsTrn, mdl_id=glbMdlFinId)                  
## Warning in glb_analytics_diag_plots(obs_df = glbObsTrn, mdl_id =
## glbMdlFinId, : Limiting important feature scatter plots to 5 out of 108

## [1] "Min/Max Boundaries: "
## [1] "Inaccurate: "
##   USER_ID Party.fctr
## 1      26          R
## 2    5879          R
## 3     599          R
## 4     660          R
## 5     470          R
## 6     403          R
##   Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet.prob
## 1                                              0.2863553
## 2                                              0.3031190
## 3                                              0.3348274
## 4                                              0.3788744
## 5                                                     NA
## 6                                              0.3401278
##   Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet
## 1                                                 D
## 2                                                 D
## 3                                                 D
## 4                                                 D
## 5                                              <NA>
## 6                                                 D
##   Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet.err
## 1                                                  TRUE
## 2                                                  TRUE
## 3                                                  TRUE
## 4                                                  TRUE
## 5                                                    NA
## 6                                                  TRUE
##   Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet.err.abs
## 1                                                 0.7136447
## 2                                                 0.6968810
## 3                                                 0.6651726
## 4                                                 0.6211256
## 5                                                        NA
## 6                                                 0.6598722
##   Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet.is.acc
## 1                                                    FALSE
## 2                                                    FALSE
## 3                                                    FALSE
## 4                                                    FALSE
## 5                                                       NA
## 6                                                    FALSE
##   Party.fctr.Final.All.X.expoTrans.spatialSign.rcv.glmnet.prob
## 1                                                    0.3881989
## 2                                                    0.3956293
## 3                                                    0.3965126
## 4                                                    0.4034179
## 5                                                    0.4035234
## 6                                                    0.4050048
##   Party.fctr.Final.All.X.expoTrans.spatialSign.rcv.glmnet
## 1                                                       D
## 2                                                       D
## 3                                                       D
## 4                                                       D
## 5                                                       D
## 6                                                       D
##   Party.fctr.Final.All.X.expoTrans.spatialSign.rcv.glmnet.err
## 1                                                        TRUE
## 2                                                        TRUE
## 3                                                        TRUE
## 4                                                        TRUE
## 5                                                        TRUE
## 6                                                        TRUE
##   Party.fctr.Final.All.X.expoTrans.spatialSign.rcv.glmnet.err.abs
## 1                                                       0.6118011
## 2                                                       0.6043707
## 3                                                       0.6034874
## 4                                                       0.5965821
## 5                                                       0.5964766
## 6                                                       0.5949952
##   Party.fctr.Final.All.X.expoTrans.spatialSign.rcv.glmnet.is.acc
## 1                                                          FALSE
## 2                                                          FALSE
## 3                                                          FALSE
## 4                                                          FALSE
## 5                                                          FALSE
## 6                                                          FALSE
##   Party.fctr.Final.All.X.expoTrans.spatialSign.rcv.glmnet.accurate
## 1                                                            FALSE
## 2                                                            FALSE
## 3                                                            FALSE
## 4                                                            FALSE
## 5                                                            FALSE
## 6                                                            FALSE
##   Party.fctr.Final.All.X.expoTrans.spatialSign.rcv.glmnet.error
## 1                                                   -0.06180115
## 2                                                   -0.05437067
## 3                                                   -0.05348737
## 4                                                   -0.04658208
## 5                                                   -0.04647663
## 6                                                   -0.04499521
##     USER_ID Party.fctr
## 22     2169          R
## 41     1343          R
## 479    1799          D
## 509    1485          D
## 575    5837          D
## 984    5544          D
##     Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet.prob
## 22                                               0.4396815
## 41                                                      NA
## 479                                              0.5609044
## 509                                              0.5570340
## 575                                              0.5600928
## 984                                              0.7386573
##     Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet
## 22                                                  D
## 41                                               <NA>
## 479                                                 R
## 509                                                 R
## 575                                                 R
## 984                                                 R
##     Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet.err
## 22                                                   TRUE
## 41                                                     NA
## 479                                                  TRUE
## 509                                                  TRUE
## 575                                                  TRUE
## 984                                                  TRUE
##     Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet.err.abs
## 22                                                  0.5603185
## 41                                                         NA
## 479                                                 0.5609044
## 509                                                 0.5570340
## 575                                                 0.5600928
## 984                                                 0.7386573
##     Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet.is.acc
## 22                                                     FALSE
## 41                                                        NA
## 479                                                    FALSE
## 509                                                    FALSE
## 575                                                    FALSE
## 984                                                    FALSE
##     Party.fctr.Final.All.X.expoTrans.spatialSign.rcv.glmnet.prob
## 22                                                     0.4349910
## 41                                                     0.4464444
## 479                                                    0.5517721
## 509                                                    0.5576558
## 575                                                    0.5676140
## 984                                                    0.7222320
##     Party.fctr.Final.All.X.expoTrans.spatialSign.rcv.glmnet
## 22                                                        D
## 41                                                        D
## 479                                                       R
## 509                                                       R
## 575                                                       R
## 984                                                       R
##     Party.fctr.Final.All.X.expoTrans.spatialSign.rcv.glmnet.err
## 22                                                         TRUE
## 41                                                         TRUE
## 479                                                        TRUE
## 509                                                        TRUE
## 575                                                        TRUE
## 984                                                        TRUE
##     Party.fctr.Final.All.X.expoTrans.spatialSign.rcv.glmnet.err.abs
## 22                                                        0.5650090
## 41                                                        0.5535556
## 479                                                       0.5517721
## 509                                                       0.5576558
## 575                                                       0.5676140
## 984                                                       0.7222320
##     Party.fctr.Final.All.X.expoTrans.spatialSign.rcv.glmnet.is.acc
## 22                                                           FALSE
## 41                                                           FALSE
## 479                                                          FALSE
## 509                                                          FALSE
## 575                                                          FALSE
## 984                                                          FALSE
##     Party.fctr.Final.All.X.expoTrans.spatialSign.rcv.glmnet.accurate
## 22                                                             FALSE
## 41                                                             FALSE
## 479                                                            FALSE
## 509                                                            FALSE
## 575                                                            FALSE
## 984                                                            FALSE
##     Party.fctr.Final.All.X.expoTrans.spatialSign.rcv.glmnet.error
## 22                                                   -0.015008966
## 41                                                   -0.003555578
## 479                                                   0.101772082
## 509                                                   0.107655765
## 575                                                   0.117614005
## 984                                                   0.272231965
##      USER_ID Party.fctr
## 995     3474          D
## 996     2641          D
## 997     1311          D
## 998       78          D
## 999     3578          D
## 1000    1309          D
##      Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet.prob
## 995                                                      NA
## 996                                               0.7627772
## 997                                                      NA
## 998                                               0.7526049
## 999                                               0.7581158
## 1000                                              0.7703249
##      Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet
## 995                                               <NA>
## 996                                                  R
## 997                                               <NA>
## 998                                                  R
## 999                                                  R
## 1000                                                 R
##      Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet.err
## 995                                                     NA
## 996                                                   TRUE
## 997                                                     NA
## 998                                                   TRUE
## 999                                                   TRUE
## 1000                                                  TRUE
##      Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet.err.abs
## 995                                                         NA
## 996                                                  0.7627772
## 997                                                         NA
## 998                                                  0.7526049
## 999                                                  0.7581158
## 1000                                                 0.7703249
##      Party.fctr.All.X.expoTrans.spatialSign.rcv.glmnet.is.acc
## 995                                                        NA
## 996                                                     FALSE
## 997                                                        NA
## 998                                                     FALSE
## 999                                                     FALSE
## 1000                                                    FALSE
##      Party.fctr.Final.All.X.expoTrans.spatialSign.rcv.glmnet.prob
## 995                                                     0.7368335
## 996                                                     0.7376522
## 997                                                     0.7393650
## 998                                                     0.7393765
## 999                                                     0.7424068
## 1000                                                    0.7520389
##      Party.fctr.Final.All.X.expoTrans.spatialSign.rcv.glmnet
## 995                                                        R
## 996                                                        R
## 997                                                        R
## 998                                                        R
## 999                                                        R
## 1000                                                       R
##      Party.fctr.Final.All.X.expoTrans.spatialSign.rcv.glmnet.err
## 995                                                         TRUE
## 996                                                         TRUE
## 997                                                         TRUE
## 998                                                         TRUE
## 999                                                         TRUE
## 1000                                                        TRUE
##      Party.fctr.Final.All.X.expoTrans.spatialSign.rcv.glmnet.err.abs
## 995                                                        0.7368335
## 996                                                        0.7376522
## 997                                                        0.7393650
## 998                                                        0.7393765
## 999                                                        0.7424068
## 1000                                                       0.7520389
##      Party.fctr.Final.All.X.expoTrans.spatialSign.rcv.glmnet.is.acc
## 995                                                           FALSE
## 996                                                           FALSE
## 997                                                           FALSE
## 998                                                           FALSE
## 999                                                           FALSE
## 1000                                                          FALSE
##      Party.fctr.Final.All.X.expoTrans.spatialSign.rcv.glmnet.accurate
## 995                                                             FALSE
## 996                                                             FALSE
## 997                                                             FALSE
## 998                                                             FALSE
## 999                                                             FALSE
## 1000                                                            FALSE
##      Party.fctr.Final.All.X.expoTrans.spatialSign.rcv.glmnet.error
## 995                                                      0.2868335
## 996                                                      0.2876522
## 997                                                      0.2893650
## 998                                                      0.2893765
## 999                                                      0.2924068
## 1000                                                     0.3020389

dsp_feats_vctr <- c(NULL)
for(var in grep(".imp", names(glb_feats_df), fixed=TRUE, value=TRUE))
    dsp_feats_vctr <- union(dsp_feats_vctr, 
                            glb_feats_df[!is.na(glb_feats_df[, var]), "id"])

# print(glbObsTrn[glbObsTrn$UniqueID %in% FN_OOB_ids, 
#                     grep(glb_rsp_var, names(glbObsTrn), value=TRUE)])

print(setdiff(names(glbObsTrn), names(glbObsAll)))
## [1] "Party.fctr.Final.All.X.expoTrans.spatialSign.rcv.glmnet.prob"   
## [2] "Party.fctr.Final.All.X.expoTrans.spatialSign.rcv.glmnet"        
## [3] "Party.fctr.Final.All.X.expoTrans.spatialSign.rcv.glmnet.err"    
## [4] "Party.fctr.Final.All.X.expoTrans.spatialSign.rcv.glmnet.err.abs"
## [5] "Party.fctr.Final.All.X.expoTrans.spatialSign.rcv.glmnet.is.acc"
for (col in setdiff(names(glbObsTrn), names(glbObsAll)))
    # Merge or cbind ?
    glbObsAll[glbObsAll$.src == "Train", col] <- glbObsTrn[, col]

print(setdiff(names(glbObsFit), names(glbObsAll)))
## character(0)
print(setdiff(names(glbObsOOB), names(glbObsAll)))
## character(0)
for (col in setdiff(names(glbObsOOB), names(glbObsAll)))
    # Merge or cbind ?
    glbObsAll[glbObsAll$.lcn == "OOB", col] <- glbObsOOB[, col]
    
print(setdiff(names(glbObsNew), names(glbObsAll)))
## character(0)
#glb2Sav(); all.equal(savObsAll, glbObsAll); all.equal(sav_models_lst, glb_models_lst)
#load(file = paste0(glbOut$pfx, "dsk_knitr.RData"))
#cmpCols <- names(glbObsAll)[!grepl("\\.Final\\.", names(glbObsAll))]; all.equal(savObsAll[, cmpCols], glbObsAll[, cmpCols]); all.equal(savObsAll[, "H.P.http"], glbObsAll[, "H.P.http"]); 

replay.petrisim(pn = glb_analytics_pn, 
    replay.trans = (glb_analytics_avl_objs <- c(glb_analytics_avl_objs, 
        "data.training.all.prediction","model.final")), flip_coord = TRUE)
## time trans    "bgn " "fit.data.training.all " "predict.data.new " "end " 
## 0.0000   multiple enabled transitions:  data.training.all data.new model.selected    firing:  model.selected 
## 1.0000    3   2 1 0 0 
## 1.0000   multiple enabled transitions:  data.training.all data.new model.selected model.final data.training.all.prediction   firing:  data.training.all.prediction 
## 2.0000    5   2 0 0 1
## Warning in replay.petrisim(pn = glb_analytics_pn, replay.trans =
## (glb_analytics_avl_objs <- c(glb_analytics_avl_objs, : Transition:
## model.final not enabled; adding missing token(s)
## Warning in replay.petrisim(pn = glb_analytics_pn, replay.trans
## = (glb_analytics_avl_objs <- c(glb_analytics_avl_objs, : Place:
## fit.data.training.all: added 1 missing token
## 2.0000   multiple enabled transitions:  data.training.all data.new model.selected model.final data.training.all.prediction   firing:  model.final 
## 3.0000    4   2 0 1 1

glb_chunks_df <- myadd_chunk(glb_chunks_df, "predict.data.new", major.inc = TRUE)
##               label step_major step_minor label_minor     bgn     end
## 5 fit.data.training          2          1           1 658.730 669.282
## 6  predict.data.new          3          0           0 669.282      NA
##   elapsed
## 5  10.552
## 6      NA

Step 3.0: predict data new

## Warning in glb_get_predictions(obs_df, mdl_id = glbMdlFinId, rsp_var =
## glb_rsp_var, : Using default probability threshold: 0.45

## Warning in glb_get_predictions(obs_df, mdl_id = glbMdlFinId, rsp_var =
## glb_rsp_var, : Using default probability threshold: 0.45
## Warning in glb_analytics_diag_plots(obs_df = glbObsNew, mdl_id =
## glbMdlFinId, : Limiting important feature scatter plots to 5 out of 108
## Warning: Removed 622 rows containing missing values (geom_point).

## Warning: Removed 622 rows containing missing values (geom_point).

## Warning: Removed 622 rows containing missing values (geom_point).

## Warning: Removed 622 rows containing missing values (geom_point).

## Warning: Removed 622 rows containing missing values (geom_point).

## Warning: Removed 622 rows containing missing values (geom_point).

## Warning: Removed 622 rows containing missing values (geom_point).

## Warning: Removed 622 rows containing missing values (geom_point).

## Warning: Removed 622 rows containing missing values (geom_point).

## Warning: Removed 622 rows containing missing values (geom_point).

## NULL
## Loading required package: tidyr
## 
## Attaching package: 'tidyr'
## The following object is masked from 'package:Matrix':
## 
##     expand
## [1] "OOBobs total range outliers: 0"
## [1] "newobs total range outliers: 0"
## [1] "Stacking file Votes_Ensemble_cnk06_out_fin.csv to prediction outputs..."
## [1] 0.45
## [1] "glbMdlSelId: All.X#expoTrans.spatialSign#rcv#glmnet"
## [1] "glbMdlFinId: Final.All.X#expoTrans.spatialSign#rcv#glmnet"
## [1] "Cross Validation issues:"
##        MFO###myMFO_classfr  Random###myrandom_classfr 
##                          0                          0 
## Max.cor.Y.rcv.1X1###glmnet 
##                          0
##                                              max.Accuracy.OOB
## All.X#expoTrans.spatialSign#rcv#glmnet              0.5936255
## All.X#spatialSign#rcv#glmnet                        0.5936255
## All.X#expoTrans#rcv#glmnet                          0.5916335
## All.X##rcv#glmnet                                   0.5896414
## All.X#YeoJohnson#rcv#glmnet                         0.5876494
## All.X#conditionalX#rcv#glmnet                       0.5856574
## Low.cor.X##rcv#glmnet                               0.5856574
## All.X#scale#rcv#glmnet                              0.5856574
## All.X#zv#rcv#glmnet                                 0.5856574
## All.X#range#rcv#glmnet                              0.5856574
## All.X#center#rcv#glmnet                             0.5856574
## All.X#center.scale#rcv#glmnet                       0.5856574
## All.X#BoxCox#rcv#glmnet                             0.5856574
## All.X#nzv#rcv#glmnet                                0.5796813
## All.X#zv.pca#rcv#glmnet                             0.5796813
## Max.cor.Y.rcv.1X1###glmnet                          0.5756972
## Max.cor.Y##rcv#rpart                                0.5737052
## All.X#ica#rcv#glmnet                                0.5737052
## Random###myrandom_classfr                           0.5737052
## MFO###myMFO_classfr                                 0.5737052
## Final.All.X#expoTrans.spatialSign#rcv#glmnet               NA
##                                              max.AUCROCR.OOB
## All.X#expoTrans.spatialSign#rcv#glmnet             0.5756912
## All.X#spatialSign#rcv#glmnet                       0.5704991
## All.X#expoTrans#rcv#glmnet                         0.5697040
## All.X##rcv#glmnet                                  0.5814512
## All.X#YeoJohnson#rcv#glmnet                        0.5696554
## All.X#conditionalX#rcv#glmnet                      0.5688766
## Low.cor.X##rcv#glmnet                              0.5688766
## All.X#scale#rcv#glmnet                             0.5688766
## All.X#zv#rcv#glmnet                                0.5688766
## All.X#range#rcv#glmnet                             0.5688766
## All.X#center#rcv#glmnet                            0.5688766
## All.X#center.scale#rcv#glmnet                      0.5688766
## All.X#BoxCox#rcv#glmnet                            0.5688766
## All.X#nzv#rcv#glmnet                               0.5784657
## All.X#zv.pca#rcv#glmnet                            0.5588331
## Max.cor.Y.rcv.1X1###glmnet                         0.5719513
## Max.cor.Y##rcv#rpart                               0.5452362
## All.X#ica#rcv#glmnet                               0.5297573
## Random###myrandom_classfr                          0.5181075
## MFO###myMFO_classfr                                0.5000000
## Final.All.X#expoTrans.spatialSign#rcv#glmnet              NA
##                                              max.AUCpROC.OOB
## All.X#expoTrans.spatialSign#rcv#glmnet             0.5600500
## All.X#spatialSign#rcv#glmnet                       0.5554420
## All.X#expoTrans#rcv#glmnet                         0.5554420
## All.X##rcv#glmnet                                  0.5541115
## All.X#YeoJohnson#rcv#glmnet                        0.5554420
## All.X#conditionalX#rcv#glmnet                      0.5554420
## Low.cor.X##rcv#glmnet                              0.5554420
## All.X#scale#rcv#glmnet                             0.5554420
## All.X#zv#rcv#glmnet                                0.5554420
## All.X#range#rcv#glmnet                             0.5554420
## All.X#center#rcv#glmnet                            0.5554420
## All.X#center.scale#rcv#glmnet                      0.5554420
## All.X#BoxCox#rcv#glmnet                            0.5554420
## All.X#nzv#rcv#glmnet                               0.5436299
## All.X#zv.pca#rcv#glmnet                            0.5017848
## Max.cor.Y.rcv.1X1###glmnet                         0.5468912
## Max.cor.Y##rcv#rpart                               0.5468912
## All.X#ica#rcv#glmnet                               0.4820223
## Random###myrandom_classfr                          0.4990752
## MFO###myMFO_classfr                                0.5000000
## Final.All.X#expoTrans.spatialSign#rcv#glmnet              NA
##                                              min.elapsedtime.everything
## All.X#expoTrans.spatialSign#rcv#glmnet                           42.917
## All.X#spatialSign#rcv#glmnet                                     20.544
## All.X#expoTrans#rcv#glmnet                                       51.149
## All.X##rcv#glmnet                                                13.519
## All.X#YeoJohnson#rcv#glmnet                                      45.222
## All.X#conditionalX#rcv#glmnet                                    13.941
## Low.cor.X##rcv#glmnet                                            14.590
## All.X#scale#rcv#glmnet                                           14.819
## All.X#zv#rcv#glmnet                                              14.938
## All.X#range#rcv#glmnet                                           15.454
## All.X#center#rcv#glmnet                                          15.479
## All.X#center.scale#rcv#glmnet                                    16.964
## All.X#BoxCox#rcv#glmnet                                          17.604
## All.X#nzv#rcv#glmnet                                             17.988
## All.X#zv.pca#rcv#glmnet                                          42.121
## Max.cor.Y.rcv.1X1###glmnet                                        0.766
## Max.cor.Y##rcv#rpart                                              1.468
## All.X#ica#rcv#glmnet                                             22.835
## Random###myrandom_classfr                                         0.272
## MFO###myMFO_classfr                                               0.501
## Final.All.X#expoTrans.spatialSign#rcv#glmnet                     48.902
##                                              max.Accuracy.fit
## All.X#expoTrans.spatialSign#rcv#glmnet              0.6128471
## All.X#spatialSign#rcv#glmnet                        0.6118257
## All.X#expoTrans#rcv#glmnet                          0.6109764
## All.X##rcv#glmnet                                   0.6126764
## All.X#YeoJohnson#rcv#glmnet                         0.6109767
## All.X#conditionalX#rcv#glmnet                       0.6128487
## Low.cor.X##rcv#glmnet                               0.6128487
## All.X#scale#rcv#glmnet                              0.6128487
## All.X#zv#rcv#glmnet                                 0.6128487
## All.X#range#rcv#glmnet                              0.6128487
## All.X#center#rcv#glmnet                             0.6128487
## All.X#center.scale#rcv#glmnet                       0.6128487
## All.X#BoxCox#rcv#glmnet                             0.6128487
## All.X#nzv#rcv#glmnet                                0.6087590
## All.X#zv.pca#rcv#glmnet                             0.5959830
## Max.cor.Y.rcv.1X1###glmnet                          0.6152274
## Max.cor.Y##rcv#rpart                                0.6136958
## All.X#ica#rcv#glmnet                                0.5918896
## Random###myrandom_classfr                           0.5789474
## MFO###myMFO_classfr                                 0.5789474
## Final.All.X#expoTrans.spatialSign#rcv#glmnet        0.5991618
##                                              opt.prob.threshold.fit
## All.X#expoTrans.spatialSign#rcv#glmnet                         0.55
## All.X#spatialSign#rcv#glmnet                                   0.55
## All.X#expoTrans#rcv#glmnet                                     0.55
## All.X##rcv#glmnet                                              0.55
## All.X#YeoJohnson#rcv#glmnet                                    0.50
## All.X#conditionalX#rcv#glmnet                                  0.55
## Low.cor.X##rcv#glmnet                                          0.55
## All.X#scale#rcv#glmnet                                         0.55
## All.X#zv#rcv#glmnet                                            0.55
## All.X#range#rcv#glmnet                                         0.55
## All.X#center#rcv#glmnet                                        0.55
## All.X#center.scale#rcv#glmnet                                  0.55
## All.X#BoxCox#rcv#glmnet                                        0.55
## All.X#nzv#rcv#glmnet                                           0.55
## All.X#zv.pca#rcv#glmnet                                        0.55
## Max.cor.Y.rcv.1X1###glmnet                                     0.50
## Max.cor.Y##rcv#rpart                                           0.50
## All.X#ica#rcv#glmnet                                           0.50
## Random###myrandom_classfr                                      0.40
## MFO###myMFO_classfr                                            0.40
## Final.All.X#expoTrans.spatialSign#rcv#glmnet                   0.55
##                                              opt.prob.threshold.OOB
## All.X#expoTrans.spatialSign#rcv#glmnet                         0.45
## All.X#spatialSign#rcv#glmnet                                   0.45
## All.X#expoTrans#rcv#glmnet                                     0.45
## All.X##rcv#glmnet                                              0.50
## All.X#YeoJohnson#rcv#glmnet                                    0.45
## All.X#conditionalX#rcv#glmnet                                  0.50
## Low.cor.X##rcv#glmnet                                          0.50
## All.X#scale#rcv#glmnet                                         0.50
## All.X#zv#rcv#glmnet                                            0.50
## All.X#range#rcv#glmnet                                         0.50
## All.X#center#rcv#glmnet                                        0.50
## All.X#center.scale#rcv#glmnet                                  0.50
## All.X#BoxCox#rcv#glmnet                                        0.50
## All.X#nzv#rcv#glmnet                                           0.50
## All.X#zv.pca#rcv#glmnet                                        0.55
## Max.cor.Y.rcv.1X1###glmnet                                     0.55
## Max.cor.Y##rcv#rpart                                           0.40
## All.X#ica#rcv#glmnet                                           0.40
## Random###myrandom_classfr                                      0.40
## MFO###myMFO_classfr                                            0.40
## Final.All.X#expoTrans.spatialSign#rcv#glmnet                     NA
## [1] "All.X#expoTrans.spatialSign#rcv#glmnet OOB confusion matrix & accuracy: "
##          Prediction
## Reference   D   R
##         D  37 177
##         R  27 261
##     err.abs.fit.sum err.abs.OOB.sum err.abs.trn.sum err.abs.new.sum
## PKn       22.893872        7.134215        30.83944              NA
## PKy        6.299374        2.971012        10.01024              NA
## SKy       28.827288       11.348368        40.69325              NA
## SKn      373.399097       97.262331       479.50176              NA
## MKy      300.522687       73.031659       380.12806              NA
## MKn      103.615614       34.933708       140.09919              NA
## N         53.063882       12.946810        67.03962              NA
##     .freqRatio.Fit .freqRatio.OOB .freqRatio.Tst .n.Fit .n.New.D .n.New.R
## PKn    0.025549310     0.02589641    0.024115756     50        2       13
## PKy    0.007153807     0.01195219    0.009646302     14        3        3
## SKy    0.031170158     0.04581673    0.043408360     61        2       25
## SKn    0.413898825     0.40039841    0.405144695    810       19      233
## MKy    0.347470618     0.31075697    0.313504823    680        2      193
## MKn    0.115482882     0.14940239    0.151125402    226        4       90
## N      0.059274400     0.05577689    0.053054662    116        1       32
##     .n.OOB .n.Trn.D .n.Trn.R .n.Tst .n.fit .n.new .n.trn err.abs.OOB.mean
## PKn     13       40       23     15     50     15     63        0.5487857
## PKy      6       13        7      6     14      6     20        0.4951687
## SKy     23       43       41     27     61     27     84        0.4934073
## SKn    201      454      557    252    810    252   1011        0.4838922
## MKy    156      306      530    195    680    195    836        0.4681517
## MKn     75      123      178     94    226     94    301        0.4657828
## N       28       59       85     33    116     33    144        0.4623861
##     err.abs.fit.mean err.abs.new.mean err.abs.trn.mean
## PKn        0.4578774               NA        0.4895149
## PKy        0.4499553               NA        0.5005122
## SKy        0.4725785               NA        0.4844434
## SKn        0.4609865               NA        0.4742846
## MKy        0.4419451               NA        0.4546986
## MKn        0.4584762               NA        0.4654458
## N          0.4574473               NA        0.4655529
##  err.abs.fit.sum  err.abs.OOB.sum  err.abs.trn.sum  err.abs.new.sum 
##       888.621814       239.628103      1148.311557               NA 
##   .freqRatio.Fit   .freqRatio.OOB   .freqRatio.Tst           .n.Fit 
##         1.000000         1.000000         1.000000      1957.000000 
##         .n.New.D         .n.New.R           .n.OOB         .n.Trn.D 
##        33.000000       589.000000       502.000000      1038.000000 
##         .n.Trn.R           .n.Tst           .n.fit           .n.new 
##      1421.000000       622.000000      1957.000000       622.000000 
##           .n.trn err.abs.OOB.mean err.abs.fit.mean err.abs.new.mean 
##      2459.000000         3.417574         3.199266               NA 
## err.abs.trn.mean 
##         3.334452
## [1] "Features Importance for selected models:"
##                                 All.X.expoTrans.spatialSign.rcv.glmnet.imp
## Q115611.fctrYes                                                 100.000000
## Q113181.fctrNo                                                   95.353402
## Hhold.fctrPKn                                                    72.373641
## Q116881.fctrRight                                                63.510220
## Q99480.fctrNo                                                    54.770504
## Q98869.fctrNo                                                    53.839298
## Q106997.fctrGr                                                   53.829347
## Q101163.fctrDad                                                  52.946272
## Q98197.fctrNo                                                    51.289537
## Hhold.fctrPKy                                                    48.897373
## Q113181.fctrYes                                                  37.083756
## Q119650.fctrGiving                                               35.721172
## Q124742.fctrNo                                                   33.972679
## Q115611.fctrNo                                                   33.931389
## Hhold.fctrMKy                                                    32.028548
## Q106272.fctrNo                                                   28.769646
## Q105655.fctrYes                                                  28.149909
## Q114517.fctrNo                                                   26.310633
## Q123621.fctrYes                                                  24.337487
## Hhold.fctrPKy:.clusterid.fctr4                                   24.070888
## Income.fctr.C                                                    23.655641
## Q100562.fctrNo                                                   21.953249
## Q109367.fctrNo                                                   21.463578
## Q120472.fctrScience                                              19.045780
## Income.fctr.Q                                                    18.779402
## Q115899.fctrCs                                                   17.701623
## Q118892.fctrNo                                                   16.927606
## Q116881.fctrHappy                                                16.826284
## Q110740.fctrPC                                                   16.247891
## YOB.Age.fctr(35,40]:YOB.Age.dff                                  14.929799
## Hhold.fctrSKy                                                    14.586868
## Income.fctr^6                                                    14.352956
## Q108855.fctrUmm...                                               14.107061
## Hhold.fctrSKy:.clusterid.fctr3                                   13.949194
## Q104996.fctrYes                                                  13.326780
## Hhold.fctrN:.clusterid.fctr4                                     13.253891
## Hhold.fctrMKy:.clusterid.fctr4                                   13.164804
## Q99716.fctrYes                                                   12.607818
## Q116953.fctrNo                                                   12.424004
## Hhold.fctrSKn:.clusterid.fctr2                                   11.397729
## Q108855.fctrYes!                                                  1.072749
## Hhold.fctrPKn:.clusterid.fctr2                                    0.000000
##                                 Final.All.X.expoTrans.spatialSign.rcv.glmnet.imp
## Q115611.fctrYes                                                       100.000000
## Q113181.fctrNo                                                         70.459984
## Hhold.fctrPKn                                                          34.259597
## Q116881.fctrRight                                                      56.769317
## Q99480.fctrNo                                                          23.670214
## Q98869.fctrNo                                                          34.890584
## Q106997.fctrGr                                                         24.282362
## Q101163.fctrDad                                                        46.078549
## Q98197.fctrNo                                                          58.192817
## Hhold.fctrPKy                                                          23.473593
## Q113181.fctrYes                                                        35.754276
## Q119650.fctrGiving                                                      0.000000
## Q124742.fctrNo                                                          0.000000
## Q115611.fctrNo                                                         34.294803
## Hhold.fctrMKy                                                           8.755206
## Q106272.fctrNo                                                         15.121509
## Q105655.fctrYes                                                         0.000000
## Q114517.fctrNo                                                          0.000000
## Q123621.fctrYes                                                         0.000000
## Hhold.fctrPKy:.clusterid.fctr4                                          0.000000
## Income.fctr.C                                                           0.000000
## Q100562.fctrNo                                                          1.705729
## Q109367.fctrNo                                                          0.000000
## Q120472.fctrScience                                                     1.909118
## Income.fctr.Q                                                           8.557590
## Q115899.fctrCs                                                          3.862864
## Q118892.fctrNo                                                          0.000000
## Q116881.fctrHappy                                                       0.000000
## Q110740.fctrPC                                                         23.109030
## YOB.Age.fctr(35,40]:YOB.Age.dff                                         8.099951
## Hhold.fctrSKy                                                           0.000000
## Income.fctr^6                                                           5.566626
## Q108855.fctrUmm...                                                      0.000000
## Hhold.fctrSKy:.clusterid.fctr3                                          0.000000
## Q104996.fctrYes                                                         0.000000
## Hhold.fctrN:.clusterid.fctr4                                            0.000000
## Hhold.fctrMKy:.clusterid.fctr4                                         20.829954
## Q99716.fctrYes                                                          1.011410
## Q116953.fctrNo                                                          1.975859
## Hhold.fctrSKn:.clusterid.fctr2                                          0.000000
## Q108855.fctrYes!                                                       14.920312
## Hhold.fctrPKn:.clusterid.fctr2                                         23.035727
## [1] "glbObsNew prediction stats:"
## 
##   D   R 
##  33 589
##                  label step_major step_minor label_minor     bgn     end
## 6     predict.data.new          3          0           0 669.282 682.556
## 7 display.session.info          4          0           0 682.556      NA
##   elapsed
## 6  13.274
## 7      NA

Null Hypothesis (\(\sf{H_{0}}\)): mpg is not impacted by am_fctr.
The variance by am_fctr appears to be independent. #{r q1, cache=FALSE} # print(t.test(subset(cars_df, am_fctr == "automatic")$mpg, # subset(cars_df, am_fctr == "manual")$mpg, # var.equal=FALSE)$conf) # We reject the null hypothesis i.e. we have evidence to conclude that am_fctr impacts mpg (95% confidence). Manual transmission is better for miles per gallon versus automatic transmission.

##               label step_major step_minor label_minor     bgn     end
## 1      fit.models_1          1          0           0   9.967 535.005
## 2        fit.models          1          1           1 535.006 597.160
## 4 fit.data.training          2          0           0 600.612 658.729
## 6  predict.data.new          3          0           0 669.282 682.556
## 5 fit.data.training          2          1           1 658.730 669.282
## 3        fit.models          1          2           2 597.161 600.612
##   elapsed duration
## 1 525.038  525.038
## 2  62.154   62.154
## 4  58.117   58.117
## 6  13.274   13.274
## 5  10.552   10.552
## 3   3.451    3.451
## [1] "Total Elapsed Time: 682.556 secs"

##                  label step_major step_minor label_minor    bgn     end
## 4 fit.models_1_preProc          1          3     preProc 13.266 534.995
## 1     fit.models_1_bgn          1          0       setup 13.244  13.253
## 3   fit.models_1_All.X          1          2      glmnet 13.260  13.266
## 2   fit.models_1_All.X          1          1       setup 13.254  13.259
##   elapsed duration
## 4 521.729  521.729
## 1   0.009    0.009
## 3   0.006    0.006
## 2   0.005    0.005
## [1] "Total Elapsed Time: 534.995 secs"